idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
42,500 | public function andRemotePropertyEquals ( $ property , $ remoteProperty , $ remoteIsValue = false ) { $ this -> getBuilder ( ) -> checkNotRoot ( ) ; return $ this -> andEncapsulate ( new PropertyEqualsFilterBuilder ( $ property , $ remoteProperty , true , ! $ remoteIsValue ) ) ; } | Ensure that the given property also equals the given remote property . |
42,501 | public function andRemotePropertyGreaterThan ( $ property , $ remoteProperty , $ remoteIsValue = false ) { $ this -> getBuilder ( ) -> checkNotRoot ( ) ; return $ this -> andEncapsulate ( new PropertyGreaterThanFilterBuilder ( $ property , $ remoteProperty , true , ! $ remoteIsValue ) ) ; } | Ensure that the given property also is greater than the given remote property . |
42,502 | public function andRemotePropertyLessThan ( $ property , $ remoteProperty , $ remoteIsValue = false ) { $ this -> getBuilder ( ) -> checkNotRoot ( ) ; return $ this -> andEncapsulate ( new PropertyLessThanFilterBuilder ( $ property , $ remoteProperty , true , ! $ remoteIsValue ) ) ; } | Ensure that the given property also is less than the given remote property . |
42,503 | private function handleInto ( ModelId $ into , RelationshipManager $ relationships , ModelCollector $ collector , ModelInterface $ model ) { if ( 0 === $ into -> getId ( ) || null === $ parent = $ collector -> getModel ( $ into ) ) { $ relationships -> setRoot ( $ model ) ; return ; } $ relationships -> setParent ( $ m... | Handle paste into . |
42,504 | private function handleAfter ( ModelId $ after , RelationshipManager $ relationships , ModelCollector $ collector , ModelInterface $ model ) { $ sibling = $ collector -> getModel ( $ after ) ; if ( ! $ sibling || $ relationships -> isRoot ( $ sibling ) ) { $ relationships -> setRoot ( $ model ) ; return ; } $ parent = ... | Handle paste after . |
42,505 | public function renderButtonsForCollection ( CollectionInterface $ collection ) { foreach ( $ collection as $ i => $ model ) { $ previous = $ collection -> get ( $ i - 1 ) ; $ next = $ collection -> get ( $ i + 1 ) ; $ this -> renderButtonsFor ( $ model , $ previous , $ next ) ; } } | Render the operation buttons for the passed models . |
42,506 | private function renderButtonsFor ( ModelInterface $ model , ModelInterface $ previous = null , ModelInterface $ next = null ) { $ modelId = ModelId :: fromModel ( $ model ) -> getSerialized ( ) ; if ( $ this -> clipboardItems ) { $ isCircular = \ in_array ( ModelId :: fromModel ( $ model ) -> getSerialized ( ) , $ thi... | Render the operation buttons for the passed model . |
42,507 | private function isHierarchical ( ) { $ dataDefinition = $ this -> environment -> getDataDefinition ( ) ; $ basicDefinition = $ dataDefinition -> getBasicDefinition ( ) ; return $ basicDefinition :: MODE_HIERARCHICAL === $ basicDefinition -> getMode ( ) ; } | If the view is hierarchical . |
42,508 | private function hasPasteButtons ( ) { return ( ( true === ( bool ) ViewHelpers :: getManualSortingProperty ( $ this -> environment ) ) && false === empty ( $ this -> clipboardItems ) ) ; } | Determining if into and after buttons shall be examined . |
42,509 | private function hasPasteNewButton ( ) { $ environment = $ this -> environment ; $ basicDefinition = $ environment -> getDataDefinition ( ) -> getBasicDefinition ( ) ; return ( ( true === ( bool ) ViewHelpers :: getManualSortingProperty ( $ environment ) ) && ( true === empty ( $ this -> clipboardItems ) ) && ( false =... | Determining if paste new buttons shall be examined . |
42,510 | private function buildCommand ( $ command , $ model , $ previous , $ next , $ isCircularReference , $ childIds ) { $ extra = ( array ) $ command -> getExtra ( ) ; $ attributes = '' ; if ( ! empty ( $ extra [ 'attributes' ] ) ) { $ attributes .= \ sprintf ( $ extra [ 'attributes' ] , $ model -> getID ( ) ) ; } $ icon = ... | Render a command button . |
42,511 | private function getChildIds ( ModelInterface $ model ) { if ( null === ( $ childCollections = $ model -> getMeta ( $ model :: CHILD_COLLECTIONS ) ) ) { return [ ] ; } $ ids = [ ModelId :: fromModel ( $ model ) -> getSerialized ( ) ] ; $ childIds = [ ] ; foreach ( $ childCollections as $ collection ) { foreach ( $ coll... | Recursively determine all child ids of the passed model . |
42,512 | private function calculateParameters ( CommandInterface $ command , $ serializedModelId ) { $ parameters = ( array ) $ command -> getParameters ( ) ; if ( $ command instanceof ToggleCommandInterface ) { $ parameters [ 'act' ] = $ command -> getName ( ) ; $ parameters [ 'id' ] = $ serializedModelId ; return $ parameters... | Calculate the special parameters for certain operations . |
42,513 | private function renderPasteNewFor ( $ modelId ) { $ label = \ sprintf ( $ this -> translate ( 'pastenew.1' ) , ModelId :: fromSerialized ( $ modelId ) -> getId ( ) ) ; return \ sprintf ( '<a href="%s" title="%s" onclick="Backend.getScrollOffset()">%s</a>' , $ this -> addToUrl ( 'act=create&after=' . $ modelId ) , ... | Render the paste new button . |
42,514 | private function renderPasteIntoButton ( GetPasteButtonEvent $ event ) { if ( null !== ( $ value = $ event -> getHtmlPasteInto ( ) ) ) { return $ value ; } $ label = $ this -> translate ( 'pasteinto.0' ) ; if ( $ event -> isPasteIntoDisabled ( ) ) { return $ this -> renderImageAsHtml ( 'pasteinto_.svg' , $ label , 'cla... | Render the paste into button . |
42,515 | private function renderPasteAfterButton ( GetPasteButtonEvent $ event ) { if ( null !== ( $ value = $ event -> getHtmlPasteAfter ( ) ) ) { return $ value ; } $ label = $ this -> translate ( 'pasteafter.0' ) ; if ( $ event -> isPasteAfterDisabled ( ) ) { return $ this -> renderImageAsHtml ( 'pasteafter_.svg' , $ label ,... | Render the paste after button . |
42,516 | private function calculateClipboardItems ( ) { $ dataDefinition = $ this -> environment -> getDataDefinition ( ) ; $ basicDefinition = $ dataDefinition -> getBasicDefinition ( ) ; $ clipboard = $ this -> environment -> getClipboard ( ) ; $ filter = new Filter ( ) ; $ filter -> andModelIsFromProvider ( $ basicDefinition... | Calculate all clipboard items for the current view . |
42,517 | private function renderImageAsHtml ( $ src , $ alt , $ attributes = '' ) { $ imageEvent = $ this -> eventDispatcher -> dispatch ( ContaoEvents :: IMAGE_GET_HTML , new GenerateHtmlEvent ( $ src , $ alt , $ attributes ) ) ; return $ imageEvent -> getHtml ( ) ; } | Render an image as HTML string . |
42,518 | private function addToUrl ( $ parameters ) { $ urlAfter = $ this -> eventDispatcher -> dispatch ( ContaoEvents :: BACKEND_ADD_TO_URL , new AddToUrlEvent ( $ parameters ) ) ; return $ urlAfter -> getUrl ( ) ; } | Add some url parameters to the current URL . |
42,519 | private function isTogglerInActiveState ( $ command , $ model ) { $ dataProvider = $ this -> environment -> getDataProvider ( $ model -> getProviderName ( ) ) ; $ propModel = $ model ; if ( $ command instanceof TranslatedToggleCommandInterface && $ dataProvider instanceof MultiLanguageDataProviderInterface ) { $ langua... | Determine the toggle state of a toggle command . |
42,520 | private function calculateHref ( CommandInterface $ command , $ model ) { $ parameters = $ this -> calculateParameters ( $ command , ModelId :: fromModel ( $ model ) -> getSerialized ( ) ) ; $ href = '' ; foreach ( $ parameters as $ key => $ value ) { $ href .= \ sprintf ( '&%s=%s' , $ key , $ value ) ; } return $ this... | Calculate the href for a command . |
42,521 | private function getCommandLabel ( CommandInterface $ command ) { if ( null === $ label = $ command -> getLabel ( ) ) { $ label = $ command -> getName ( ) ; } $ label = $ this -> translate ( $ label ) ; return \ is_array ( $ label ) ? $ label [ 0 ] : $ label ; } | Get the correct label for a command button . |
42,522 | public function setTarget ( $ target ) { if ( ( ! $ target instanceof PaletteInterface ) && ( ! $ target instanceof PropertyInterface ) ) { throw new DcGeneralInvalidArgumentException ( ) ; } $ this -> target = $ target ; return $ this ; } | Set the target . |
42,523 | private function modelIsFromProvider ( $ conjunction , $ modelProviderName ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: MODEL_IS_FROM_PROVIDER_EXPRESSION , $ index ) ; $ this -> varia... | Add model is from provider fragment . |
42,524 | private function modelIsNotFromProvider ( $ conjunction , $ modelProviderName ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: MODEL_IS_NOT_FROM_PROVIDER_EXPRESSION , $ index ) ; $ this -... | Add model is not from provider . |
42,525 | private function modelIs ( $ conjunction , ModelId $ modelId ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: MODEL_IS_EXPRESSION , $ index ) ; $ this -> variables [ ] = $ modelId ; $ thi... | Add model is . |
42,526 | private function modelIsNot ( $ conjunction , ModelId $ modelId ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: MODEL_IS_NOT_EXPRESSION , $ index ) ; $ this -> variables [ ] = $ modelId ... | Add model is not . |
42,527 | private function parentIsFromProvider ( $ conjunction , $ parentProviderName ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: PARENT_IS_FROM_PROVIDER_EXPRESSION , $ index ) ; $ this -> va... | Add parent is from provider . |
42,528 | private function parentIsNotFromProvider ( $ conjunction , $ parentProviderName ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: PARENT_IS_NOT_FROM_PROVIDER_EXPRESSION , $ index ) ; $ thi... | And parent is not from provider . |
42,529 | private function hasNoParent ( $ conjunction ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ this -> expression [ ] = self :: HAS_NO_PARENT_EXPRESSION ; $ this -> compiled = null ; return $ this ; } | Add has no parent . |
42,530 | private function parentIs ( $ conjunction , ModelId $ parentModelId ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: PARENT_IS_EXPRESSION , $ index ) ; $ this -> variables [ ] = $ parentM... | Add parent is . |
42,531 | private function parentIsIn ( $ conjunction , array $ parentModelIds ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ expression = [ ] ; foreach ( $ parentModelIds as $ parentModelId ) { $ index = \ count ( $ this -> variables ) ; $ expression [ ] = \ sprintf ( self :: PARENT... | Add parent is in . |
42,532 | private function parentIsNot ( $ conjunction , ModelId $ parentModelId ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: PARENT_IS_NOT_EXPRESSION , $ index ) ; $ this -> variables [ ] = $ ... | Add parent is not . |
42,533 | private function parentIsNotIn ( $ conjunction , array $ parentModelIds ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ expression = [ ] ; foreach ( $ parentModelIds as $ parentModelId ) { $ index = \ count ( $ this -> variables ) ; $ expression [ ] = \ sprintf ( self :: PAR... | Add parent is not in . |
42,534 | private function actionIsIn ( $ conjunction , array $ actions ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ expression = [ ] ; foreach ( $ actions as $ action ) { $ index = \ count ( $ this -> variables ) ; $ expression [ ] = \ sprintf ( self :: ACTION_IS_EXPRESSION , $ in... | Add action is in . |
42,535 | private function actionIsNotIn ( $ conjunction , array $ actions ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ expression = [ ] ; foreach ( $ actions as $ action ) { $ index = \ count ( $ this -> variables ) ; $ expression [ ] = \ sprintf ( self :: ACTION_IS_NOT_EXPRESSION... | Add action is not in . |
42,536 | private function sub ( $ conjunction , FilterInterface $ filter ) { if ( ! empty ( $ this -> expression ) ) { $ this -> expression [ ] = $ conjunction ; } $ index = \ count ( $ this -> variables ) ; $ this -> expression [ ] = \ sprintf ( self :: SUB_FILTER , $ index ) ; $ this -> variables [ ] = $ filter ; $ this -> co... | Add sub filter . |
42,537 | public function render ( ) { $ commands = $ this -> environment -> getDataDefinition ( ) -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) -> getGlobalCommands ( ) -> getCommands ( ) ; if ( ! \ is_array ( $ commands ) ) { $ commands = [ ] ; } $ buttons = [ ] ; foreach ( $ commands as $ command ) { if (... | Generate all global operation buttons for a view . |
42,538 | private function renderButton ( CommandInterface $ command ) { $ extra = $ command -> getExtra ( ) ; $ label = $ this -> translate ( $ command -> getLabel ( ) ) ; if ( isset ( $ extra [ 'href' ] ) ) { $ href = $ extra [ 'href' ] ; } else { $ href = '' ; foreach ( $ command -> getParameters ( ) as $ key => $ value ) { $... | Render a single header button . |
42,539 | private function checkPermission ( ActionEvent $ event ) { $ environment = $ event -> getEnvironment ( ) ; if ( true === $ environment -> getDataDefinition ( ) -> getBasicDefinition ( ) -> isEditable ( ) ) { return true ; } $ event -> setResponse ( \ sprintf ( '<div style="text-align:center; font-weight:bold; padding:4... | Check permission for toggle property . |
42,540 | private function getModelId ( EnvironmentInterface $ environment ) { $ inputProvider = $ environment -> getInputProvider ( ) ; if ( $ inputProvider -> hasParameter ( 'id' ) && $ inputProvider -> getParameter ( 'id' ) ) { $ modelId = ModelId :: fromSerialized ( $ inputProvider -> getParameter ( 'id' ) ) ; } if ( ! ( iss... | Retrieve the model id from the input provider and validate it . |
42,541 | private function getOperation ( Action $ action , EnvironmentInterface $ environment ) { $ definition = $ environment -> getDataDefinition ( ) -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) ; $ name = $ action -> getName ( ) ; $ commands = $ definition -> getModelCommands ( ) ; if ( ! $ commands -> ... | Retrieve the toggle operation being executed . |
42,542 | private function determineNewState ( InputProviderInterface $ inputProvider , $ isInverse ) { $ state = 1 === ( int ) $ inputProvider -> getParameter ( 'state' ) ; if ( $ isInverse ) { return $ state ? '' : '1' ; } return $ state ? '1' : '' ; } | Determine the new state from the input data . |
42,543 | private function buildFieldSets ( Action $ action , \ ArrayObject $ renderInformation , EnvironmentInterface $ environment ) { $ formInputs = $ environment -> getInputProvider ( ) -> getValue ( 'FORM_INPUTS' ) ; $ collection = $ this -> getCollectionFromSession ( $ action , $ environment ) ; $ fieldSets = [ ] ; $ error... | Build the field sets for each model . |
42,544 | private function handleLegendCollapsed ( array $ fieldSets ) { $ editInformation = $ GLOBALS [ 'container' ] [ 'dc-general.edit-information' ] ; if ( ! $ editInformation -> hasAnyModelError ( ) ) { return $ fieldSets ; } foreach ( \ array_keys ( $ fieldSets ) as $ index ) { if ( $ editInformation -> getModelError ( $ f... | Handle legend how are open if errors available . |
42,545 | private function renderEditFields ( Action $ action , ContaoWidgetManager $ widgetManager , ModelInterface $ model , PropertyValueBagInterface $ propertyValuesBag , EnvironmentInterface $ environment ) { $ properties = $ environment -> getDataDefinition ( ) -> getPropertiesDefinition ( ) ; $ selectProperties = ( array ... | Render the edit fields . |
42,546 | private function getVisibleModel ( Action $ action , ModelInterface $ editModel , DataProviderInterface $ dataProvider , EnvironmentInterface $ environment ) { $ selectProperties = ( array ) $ this -> getPropertiesFromSession ( $ action , $ environment ) ; $ visibleModel = $ dataProvider -> getEmptyModel ( ) ; $ visibl... | Get the visible model . |
42,547 | private function markEditErrors ( PropertyInterface $ editProperty , PropertyInterface $ selectProperty , PropertyValueBagInterface $ propertyValuesBag ) { if ( ( $ editErrors = $ propertyValuesBag -> getInvalidPropertyErrors ( ) ) && \ array_key_exists ( $ selectProperty -> getName ( ) , $ editErrors ) ) { $ propertyV... | Mark edit errors . |
42,548 | private function markModelErrors ( Action $ action , ModelInterface $ model , ModelInterface $ editModel , PropertyInterface $ editProperty , PropertyInterface $ selectProperty , PropertyValueBagInterface $ propertyValuesBag , EnvironmentInterface $ environment ) { $ editInformation = $ GLOBALS [ 'container' ] [ 'dc-ge... | Mark model errors . |
42,549 | private function handleEditCollection ( Action $ action , PropertyValueBagInterface $ editPropertyValuesBag , ModelInterface $ model , \ ArrayObject $ renderInformation , EnvironmentInterface $ environment ) { $ dataProvider = $ environment -> getDataProvider ( $ model -> getProviderName ( ) ) ; $ editCollection = $ da... | Handle edit collection of models . |
42,550 | private function buildEditProperty ( PropertyInterface $ originalProperty , ModelIdInterface $ modelId ) { $ editPropertyClass = \ get_class ( $ originalProperty ) ; $ editPropertyName = \ str_replace ( '::' , ' _' , $ modelId -> getSerialized ( ) ) . '_' . $ originalProperty -> getName ( ) ; $ editProperty = new $ edi... | Build edit property from the original property . |
42,551 | public function setPaletteCollectionClassName ( $ paletteCollectionClassName ) { $ event = new SetPaletteCollectionClassNameEvent ( $ paletteCollectionClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ paletteCollectionClassName = $ event -> getPaletteCollectionClassName ( ) ; $ this -> paletteCollectionCla... | Set the palette collection class name . |
42,552 | public function setPaletteClassName ( $ paletteClassName ) { $ event = new SetPaletteClassNameEvent ( $ paletteClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ paletteClassName = $ event -> getPaletteClassName ( ) ; $ this -> paletteClassName = ( string ) $ paletteClassName ; $ this -> paletteClass = new ... | Set the palette class name . |
42,553 | public function setLegendClassName ( $ legendClassName ) { $ event = new SetLegendClassNameEvent ( $ legendClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ legendClassName = $ event -> getLegendClassName ( ) ; $ this -> legendClassName = ( string ) $ legendClassName ; $ this -> legendClass = new \ Reflect... | Set the legend class name . |
42,554 | public function setPropertyClassName ( $ propertyClassName ) { $ event = new SetPropertyClassNameEvent ( $ propertyClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ propertyClassName = $ event -> getPropertyClassName ( ) ; $ this -> propertyClassName = ( string ) $ propertyClassName ; $ this -> propertyCla... | Set the property class name . |
42,555 | public function setPaletteConditionChainClassName ( $ paletteConditionChainClassName ) { $ event = new SetPaletteConditionChainClassNameEvent ( $ paletteConditionChainClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ paletteConditionChainClassName = $ event -> getPaletteConditionChainClassName ( ) ; $ this... | Set the palette condition chain class name . |
42,556 | public function setDefaultPaletteConditionClassName ( $ defaultPaletteConditionClassName ) { $ event = new SetDefaultPaletteConditionClassNameEvent ( $ defaultPaletteConditionClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ defaultPaletteConditionClassName = $ event -> getDefaultPaletteConditionClassName ... | Set the default palette condition class name . |
42,557 | public function setPalettePropertyValueConditionClassName ( $ palettePropertyValueConditionClassName ) { $ event = new SetPalettePropertyValueConditionClassNameEvent ( $ palettePropertyValueConditionClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ palettePropertyValueConditionClassName = $ event -> getPal... | Set the palette property value condition class name . |
42,558 | public function setPropertyConditionChainClassName ( $ propertyConditionChainClassName ) { $ event = new SetPropertyConditionChainClassNameEvent ( $ propertyConditionChainClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ propertyConditionChainClassName = $ event -> getPalettePropertyConditionChainClassName... | Set the property condition chain class name . |
42,559 | public function setPropertyValueConditionClassName ( $ propertyValueConditionClassName ) { $ event = new SetPropertyValueConditionClassNameEvent ( $ propertyValueConditionClassName , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ propertyValueConditionClassName = $ event -> getPropertyValueConditionClassName ( ) ; ... | Set the property value condition class name . |
42,560 | public function usePaletteCollection ( PaletteCollectionInterface $ paletteCollection ) { if ( $ this -> paletteCollection ) { $ this -> finishPaletteCollection ( ) ; } $ event = new UsePaletteCollectionEvent ( $ paletteCollection , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ this -> paletteCollection = $ palett... | Reuse an existing palette collection . |
42,561 | public function createPaletteCollection ( ) { if ( $ this -> paletteCollection ) { $ this -> finishPaletteCollection ( ) ; } $ paletteCollection = $ this -> paletteCollectionClass -> newInstance ( ) ; $ event = new CreatePaletteCollectionEvent ( $ paletteCollection , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ t... | Start a new palette collection . |
42,562 | public function finishPaletteCollection ( & $ collection = null ) { if ( ! $ this -> paletteCollection ) { throw new DcGeneralRuntimeException ( 'Palette collection is missing, please create a palette collection first' ) ; } if ( $ this -> palette ) { $ this -> finishPalette ( ) ; } $ event = new FinishPaletteCollectio... | Finish the current palette collection . |
42,563 | public function usePalette ( PaletteInterface $ palette ) { if ( $ this -> palette ) { $ this -> finishPalette ( ) ; } $ event = new UsePaletteEvent ( $ palette , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ this -> palette = $ palette ; return $ this ; } | Reuse an existing palette . |
42,564 | public function createPalette ( $ name = null ) { if ( $ this -> palette ) { $ this -> finishPalette ( ) ; } $ palette = $ this -> paletteClass -> newInstance ( ) ; if ( $ name ) { $ palette -> setName ( $ name ) ; } $ event = new CreatePaletteEvent ( $ palette , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ this ... | Start a new palette . |
42,565 | public function finishPalette ( & $ palette = null ) { if ( ! $ this -> palette ) { throw new DcGeneralRuntimeException ( 'Palette is missing, please create a palette first' ) ; } if ( $ this -> legend ) { $ this -> finishLegend ( ) ; } if ( $ this -> condition ) { $ this -> finishCondition ( ) ; } $ event = new Finish... | Finish the current palette . |
42,566 | public function useLegend ( LegendInterface $ legend ) { if ( $ this -> legend ) { $ this -> finishLegend ( ) ; } $ event = new UseLegendEvent ( $ legend , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ this -> legend = $ legend ; return $ this ; } | Reuse an existing legend . |
42,567 | public function createLegend ( $ name ) { if ( $ this -> legend ) { $ this -> finishLegend ( ) ; } $ legend = $ this -> legendClass -> newInstance ( $ name ) ; $ event = new CreateLegendEvent ( $ legend , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ this -> legend = $ event -> getLegend ( ) ; return $ this ; } | Start a new legend . |
42,568 | public function finishLegend ( & $ legend = null ) { if ( ! $ this -> legend ) { throw new DcGeneralRuntimeException ( 'Legend is missing, please create a legend first' ) ; } if ( $ this -> property ) { $ this -> finishProperty ( ) ; } $ event = new FinishLegendEvent ( $ this -> legend , $ this ) ; $ this -> dispatchEv... | Finish the current legend . |
42,569 | public function useProperty ( $ property , $ _ = null ) { if ( $ this -> property ) { $ this -> finishProperty ( ) ; } $ properties = \ func_get_args ( ) ; $ this -> property = [ ] ; foreach ( $ properties as $ property ) { $ event = new UsePropertyEvent ( $ property , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $... | Reuse an existing property or set of properties . |
42,570 | public function createProperty ( $ propertyName , $ _ = null ) { if ( $ this -> property ) { $ this -> finishProperty ( ) ; } $ propertyNames = \ func_get_args ( ) ; $ this -> property = [ ] ; foreach ( $ propertyNames as $ propertyName ) { $ property = $ this -> propertyClass -> newInstance ( $ propertyName ) ; $ even... | Start a new single property or set of properties . |
42,571 | public function finishProperty ( & $ property = null ) { if ( ! $ this -> property ) { throw new DcGeneralRuntimeException ( 'Property is missing, please create a property first' ) ; } if ( $ this -> condition ) { $ this -> finishCondition ( ) ; } $ properties = \ is_object ( $ this -> property ) ? [ $ this -> property... | Finish the current property or set of properties . |
42,572 | public function createDefaultPaletteCondition ( ) { if ( $ this -> condition ) { $ this -> finishCondition ( ) ; } if ( ! $ this -> palette ) { throw new DcGeneralRuntimeException ( 'Does not know where to create the property-value condition, please create a palette or property first' ) ; } $ condition = $ this -> defa... | Start a new default - palette condition . |
42,573 | public function chainDefaultPaletteCondition ( ) { if ( ! $ this -> palette ) { throw new DcGeneralRuntimeException ( 'Does not know where to create the property-value condition, please create a palette or property first' ) ; } $ this -> createPaletteConditionChain ( ) ; $ condition = $ this -> defaultPaletteConditionC... | Start a new default - palette condition and chain with previous condition . |
42,574 | public function createPropertyValueCondition ( $ propertyName , $ propertyValue , $ strict = false ) { if ( $ this -> condition ) { $ this -> finishCondition ( ) ; } if ( $ this -> property ) { $ condition = $ this -> propertyValueConditionClass -> newInstance ( ) ; } elseif ( $ this -> palette ) { $ condition = $ this... | Start a new property - value condition . |
42,575 | public function chainPropertyValueCondition ( $ propertyName , $ propertyValue , $ strict = false , $ conjunction = PropertyConditionChain :: AND_CONJUNCTION ) { if ( $ this -> property ) { $ this -> createPropertyConditionChain ( $ conjunction ) ; $ condition = $ this -> propertyValueConditionClass -> newInstance ( ) ... | Start a new property - value condition and chain with previous condition . |
42,576 | public function finishCondition ( & $ condition = null ) { if ( ! $ this -> condition ) { throw new DcGeneralRuntimeException ( 'Condition is missing, please create a condition first' ) ; } $ event = new FinishConditionEvent ( $ this -> condition , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ condition = $ event ... | Finish the current condition . |
42,577 | protected function addPaletteCondition ( PaletteConditionInterface $ condition ) { if ( ! $ this -> palette ) { throw new DcGeneralRuntimeException ( 'Palette is missing, please create a palette first' ) ; } $ event = new AddConditionEvent ( $ condition , $ this -> palette , $ this ) ; $ this -> dispatchEvent ( $ event... | Add a custom condition to last created palette . |
42,578 | protected function addPropertyCondition ( PropertyConditionInterface $ condition , $ scope = self :: VISIBLE ) { if ( ! $ this -> property ) { throw new DcGeneralRuntimeException ( 'Property is missing, please create a property first' ) ; } $ properties = \ is_object ( $ this -> property ) ? [ $ this -> property ] : $ ... | Add a custom condition to last created property . |
42,579 | public function addCondition ( $ condition , $ scope = self :: VISIBLE ) { if ( $ condition instanceof PaletteConditionInterface ) { $ this -> addPaletteCondition ( $ condition ) ; return $ this ; } if ( $ condition instanceof PropertyConditionInterface ) { $ this -> addPropertyCondition ( $ condition , $ scope ) ; ret... | Add a custom condition to last created property or palette . |
42,580 | protected function dispatchEvent ( BuilderEvent $ event ) { $ dispatcher = $ GLOBALS [ 'container' ] [ 'event-dispatcher' ] ; $ dispatcher -> dispatch ( $ event :: NAME , $ event ) ; } | Dispatch an event over the global event dispatcher . |
42,581 | protected function guardIsDeletable ( EnvironmentInterface $ environment , ModelIdInterface $ modelId , $ redirect = false ) { $ dataDefinition = $ environment -> getDataDefinition ( ) ; if ( $ dataDefinition -> getBasicDefinition ( ) -> isDeletable ( ) ) { return ; } if ( false === $ redirect ) { throw new NotDeletabl... | Check if is it allowed to delete a record . |
42,582 | protected function fetchModel ( EnvironmentInterface $ environment , ModelIdInterface $ modelId ) { $ dataProvider = $ environment -> getDataProvider ( $ modelId -> getDataProviderName ( ) ) ; $ model = $ dataProvider -> fetch ( $ dataProvider -> getEmptyConfig ( ) -> setId ( $ modelId -> getId ( ) ) ) ; if ( ! $ model... | Fetch the model . |
42,583 | public function delete ( EnvironmentInterface $ environment , ModelIdInterface $ modelId ) { $ this -> guardNotEditOnly ( $ environment -> getDataDefinition ( ) , $ modelId ) ; $ this -> guardIsDeletable ( $ environment , $ modelId ) ; $ model = $ this -> fetchModel ( $ environment , $ modelId ) ; $ preDeleteEvent = ne... | Delete an model . |
42,584 | private function checkPermission ( EnvironmentInterface $ environment ) { if ( true === $ environment -> getDataDefinition ( ) -> getBasicDefinition ( ) -> isDeletable ( ) ) { return true ; } return \ sprintf ( '<div style="text-align:center; font-weight:bold; padding:40px;"> You have no permission for d... | Check permission for delete a model . |
42,585 | protected function deepDelete ( EnvironmentInterface $ environment , ModelIdInterface $ modelId ) { $ relationships = $ environment -> getDataDefinition ( ) -> getDefinition ( 'model-relationships' ) ; $ childConditions = $ relationships -> getChildConditions ( $ modelId -> getDataProviderName ( ) ) ; foreach ( $ child... | Delete all deep models . |
42,586 | public function build ( ) { $ panel = new DefaultPanelContainer ( ) ; $ panel -> setEnvironment ( $ this -> environment ) ; $ viewDefinition = $ this -> environment -> getDataDefinition ( ) -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) ; foreach ( $ viewDefinition -> getPanelLayout ( ) -> getRows (... | Build the panel . |
42,587 | private function createElement ( $ element ) { if ( $ element instanceof FilterElementInformationInterface ) { $ panelElement = new DefaultFilterElement ( ) ; return $ panelElement -> setPropertyName ( $ element -> getPropertyName ( ) ) ; } if ( $ element instanceof LimitElementInformationInterface ) { return new Defau... | Create the panel element . |
42,588 | private function buildSearchElement ( $ element ) { $ panelElement = new DefaultSearchElement ( ) ; foreach ( $ element -> getPropertyNames ( ) as $ propName ) { $ panelElement -> addProperty ( $ propName ) ; } return $ panelElement ; } | Build a search element . |
42,589 | public function isRoot ( ModelInterface $ model ) { if ( BasicDefinitionInterface :: MODE_HIERARCHICAL !== $ this -> mode ) { return false ; } $ condition = $ this -> relationships -> getRootCondition ( ) ; if ( ! $ condition instanceof RootConditionInterface ) { throw new DcGeneralRuntimeException ( 'No root condition... | Check if the given model is a root model for the current data definition . |
42,590 | public function setRoot ( ModelInterface $ model ) { if ( BasicDefinitionInterface :: MODE_HIERARCHICAL !== $ this -> mode ) { return ; } $ condition = $ this -> relationships -> getRootCondition ( ) ; if ( ! $ condition instanceof RootConditionInterface ) { throw new DcGeneralRuntimeException ( 'No root condition defi... | Apply the root condition of the current data definition to the given model . |
42,591 | public function setParent ( ModelInterface $ childModel , ModelInterface $ parentModel ) { $ condition = $ this -> relationships -> getChildCondition ( $ parentModel -> getProviderName ( ) , $ childModel -> getProviderName ( ) ) ; if ( ! $ condition instanceof ParentChildConditionInterface ) { throw new DcGeneralRuntim... | Set a model as the parent of another model . |
42,592 | public function setParentForAll ( CollectionInterface $ models , ModelInterface $ parentModel ) { foreach ( $ models as $ model ) { $ this -> setParent ( $ model , $ parentModel ) ; } } | Sets the parent for all models . |
42,593 | public function setSameParent ( ModelInterface $ receivingModel , ModelInterface $ sourceModel , $ parentTable ) { $ condition = $ this -> relationships -> getChildCondition ( $ parentTable , $ receivingModel -> getProviderName ( ) ) ; if ( ! $ condition instanceof ParentChildConditionInterface ) { throw new DcGeneralR... | Sets all parent condition fields in the destination to the values from the source model . |
42,594 | public function setSameParentForAll ( CollectionInterface $ models , ModelInterface $ sourceModel , $ parentTable ) { foreach ( $ models as $ model ) { $ this -> setSameParent ( $ model , $ sourceModel , $ parentTable ) ; } } | Sets the same parent for all models . |
42,595 | public function handlePrePersistModelEvent ( PrePersistModelEvent $ event ) { $ enviroment = $ event -> getEnvironment ( ) ; $ dataDefinition = $ enviroment -> getDataDefinition ( ) ; if ( null === ( $ parentDataDefinition = $ enviroment -> getParentDataDefinition ( ) ) || ( false === $ dataDefinition -> getPropertiesD... | Handle the pre persist model event . |
42,596 | protected function getSerializedValue ( ) { if ( null === $ this -> varValue ) { $ this -> varValue = [ ] ; } return \ implode ( ',' , \ array_map ( '\Contao\StringUtil::binToUuid' , $ this -> varValue ) ) ; } | Get the value serialized as string . |
42,597 | private function checkPermission ( EnvironmentInterface $ environment ) { $ dataDefinition = $ environment -> getDataDefinition ( ) ; if ( true === $ dataDefinition -> getBasicDefinition ( ) -> isCreatable ( ) ) { return true ; } return \ sprintf ( '<div style="text-align:center; font-weight:bold; padding:40px;"> ... | Check permission for create a model . |
42,598 | protected function handleGlobalCommands ( EnvironmentInterface $ environment ) { $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ backendView = $ dataDefinition -> getDefinition ( Contao2BackendViewDefinitionInterface :: NAME ) ; $ globalCommands = $ backendView -> getGlobalCommands ( ) ; $ globalCommands ... | Handle the globals commands |
42,599 | protected function renderModel ( ModelInterface $ model , EnvironmentInterface $ environment ) { $ event = new FormatModelLabelEvent ( $ environment , $ model ) ; $ environment -> getEventDispatcher ( ) -> dispatch ( DcGeneralEvents :: FORMAT_MODEL_LABEL , $ event ) ; $ model -> setMeta ( $ model :: LABEL_VALUE , $ eve... | Render a model . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.