idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
44,000 | public function syncCategories ( ) { $ this -> output -> writeln ( dt ( 'Synchronizing all commerce categories, please wait...' ) ) ; $ response = $ this -> acmCategoryManager -> synchronizeTree ( $ this -> categoryVid ) ; if ( ! empty ( $ response [ 'created' ] ) || ! empty ( $ response [ 'updated' ] ) ) { $ orphan_ca... | Run a full synchronization of all commerce product category records . |
44,001 | public function syncProductOptions ( ) { $ this -> logger -> notice ( dt ( 'Synchronizing all commerce product options, please wait...' ) ) ; $ this -> productOptionsManager -> synchronizeProductOptions ( ) ; $ this -> logger -> notice ( dt ( 'Product attribute sync completed.' ) ) ; } | Run a full synchronization of all commerce product options . |
44,002 | public function removeCategoryDuplicates ( ) { $ this -> output -> writeln ( dt ( 'Cleaning all commerce categories, please wait...' ) ) ; $ db = $ this -> connection ; $ termStorage = \ Drupal :: entityTypeManager ( ) -> getStorage ( 'taxonomy_term' ) ; $ nodeStorage = \ Drupal :: entityTypeManager ( ) -> getStorage (... | Remove all duplicate categories available in system . |
44,003 | public function flushSyncedData ( ) { if ( ! $ this -> io ( ) -> confirm ( dt ( "Are you sure you want to clean commerce data?" ) ) ) { throw new UserAbortException ( ) ; } $ this -> output -> writeln ( dt ( 'Cleaning synced commerce data, please wait...' ) ) ; $ batch = [ 'title' => t ( 'Clean synced data' ) , 'init_m... | Flush all commerce data from the site . |
44,004 | public function flushLinkedSkuCache ( array $ options = [ 'sku' => NULL ] ) { if ( ! empty ( $ options [ 'sku' ] ) ) { if ( $ sku_entity = SKU :: loadFromSku ( $ options [ 'sku' ] ) ) { $ this -> cacheTagsInvalidator -> invalidateTags ( [ 'acm_sku:linked_skus:' . $ sku_entity -> id ( ) , 'acm_sku:' . $ sku_entity -> id... | Clear linked SKUs cache . |
44,005 | public function formIdentFallback ( ) { $ metadata = $ this -> obj ( ) -> metadata ( ) ; if ( isset ( $ metadata [ 'admin' ] [ 'default_quick_form' ] ) ) { return $ metadata [ 'admin' ] [ 'default_quick_form' ] ; } if ( isset ( $ this -> formData ( ) [ 'form_ident' ] ) ) { $ ident = $ this -> formData ( ) [ 'form_ident... | Retrieve the identifier of the form to use or its fallback . |
44,006 | public static function get ( ContainerInterface $ container ) { $ storage_type = $ container -> get ( 'config.factory' ) -> get ( 'acm.commerce_users' ) -> get ( 'storage_type' ) ; switch ( $ storage_type ) { case 'database_store' : $ storage = $ container -> get ( 'acm.database_session_store' ) -> get ( 'acm' ) ; brea... | Creates a Storage object . |
44,007 | public function run ( RequestInterface $ request , ResponseInterface $ response ) { $ path = $ request -> getParam ( 'upload_path' ) ; if ( ! ! $ path ) { $ this -> setUploadPath ( $ path ) ; } $ this -> uploadedPath = $ this -> fileUpload ( $ _FILES [ 'file' ] ) ; $ this -> setSuccess ( ! ! $ this -> uploadedPath ) ; ... | Gets a psr7 request and response and returns a response . |
44,008 | protected function isAbsolutePath ( $ file ) { return strspn ( $ file , '/\\' , 0 , 1 ) || ( strlen ( $ file ) > 3 && ctype_alpha ( $ file [ 0 ] ) && substr ( $ file , 1 , 1 ) === ':' && strspn ( $ file , '/\\' , 2 , 1 ) ) || null !== parse_url ( $ file , PHP_URL_SCHEME ) ; } | Determine if the given file path is am absolute path . |
44,009 | public function sanitizeFilename ( $ filename ) { $ blacklist = [ '/' , '\\' , '\0' , '*' , ':' , '?' , '"' , '<' , '>' , '|' , '#' , '&' , '!' , '`' , ' ' ] ; $ filename = str_replace ( $ blacklist , '_' , $ filename ) ; $ filename = ltrim ( $ filename , '.' ) ; return $ filename ; } | Sanitize a filename by removing characters from a blacklist and escaping dot . |
44,010 | protected function createConnection ( $ host , $ port , $ methods , $ callbacks ) { return @ ssh2_connect ( $ host , $ port , $ methods , $ callbacks ) ; } | Create SSH2 connection . |
44,011 | public function buildForm ( array $ form , FormStateInterface $ form_state ) { $ form [ 'actions' ] [ '#type' ] = 'actions' ; if ( $ category_vid = $ this -> connectorConfig -> get ( 'category_vid' ) ) { $ form [ 'actions' ] [ 'cats' ] = [ '#type' => 'submit' , '#value' => t ( 'Synchronize Categories' ) , ] ; } $ form ... | Define the form used for settings . |
44,012 | public function buildSummary ( array $ orders = [ ] ) { if ( empty ( $ orders ) ) { return [ '#markup' => $ this -> t ( 'You have no orders' ) , ] ; } $ build = [ ] ; foreach ( $ orders as $ order ) { $ build [ ] = [ '#theme' => 'user_order' , '#order' => $ order , '#order_details_path' => Url :: fromRoute ( 'acm_custo... | Builds a summary of orders . |
44,013 | private function deleteToken ( $ token ) { $ obj = $ this -> modelFactory ( ) -> create ( LostPasswordToken :: class ) ; $ obj -> setToken ( $ token ) ; $ obj -> delete ( ) ; } | Delete the given password reset token . |
44,014 | public function setDisplayOptions ( array $ options ) { if ( ! is_array ( $ options ) ) { throw new \ RuntimeException ( 'The display options must be an associative array.' ) ; } $ this -> displayOptions = array_merge ( $ this -> defaultDisplayOptions ( ) , $ options ) ; return $ this ; } | Set the display options for the widget . |
44,015 | public function setFormData ( array $ data ) { $ objData = $ this -> objData ( ) ; $ merged = array_replace_recursive ( $ objData , $ data ) ; $ merged = array_filter ( $ merged , function ( $ val ) { if ( $ val === null ) { return false ; } return true ; } ) ; $ this -> formData = $ merged ; $ this -> obj ( ) -> setDa... | Set the form s auxiliary data . |
44,016 | public function getCartSkus ( ) { $ items = $ this -> items ( ) ; if ( empty ( $ items ) ) { return [ ] ; } $ skus = [ ] ; foreach ( $ items as $ item ) { $ skus [ ] = $ item [ 'sku' ] ; } return $ skus ; } | Get skus of current cart items . |
44,017 | public function pushCart ( ) { $ cart = $ this -> cart ; if ( ! $ cart ) { return ; } $ this -> setCookie ( 'acm_cart_id' , $ cart -> id ( ) ) ; $ update = $ cart -> getCart ( ) ; $ cart_event = $ this -> eventDispatcher -> dispatch ( Events :: PUSH_CART , new CartPushEvent ( $ update ) ) ; $ cart_response = ( object )... | Pushes the cart to the ecommerce app via the Connector API . |
44,018 | public function clearCartItemsStockCache ( ) { $ items = $ this -> items ( ) ; if ( empty ( $ items ) ) { return ; } foreach ( $ items as $ item ) { $ sku_entity = SKU :: loadFromSku ( $ item [ 'sku' ] ) ; $ sku_entity -> refreshStock ( ) ; } } | Helper function to clear stock cache of all items in cart . |
44,019 | protected function getCustomerId ( ) { $ customer_id = NULL ; $ current_user = $ this -> getCurrentUser ( ) ; if ( $ current_user -> isAnonymous ( ) ) { return $ customer_id ; } $ use_ecomm_sessions = \ Drupal :: config ( 'acm.commerce_users' ) -> get ( 'use_ecomm_sessions' ) ; if ( $ use_ecomm_sessions ) { $ customer_... | Gets the current customer user id . |
44,020 | public function previewVal ( ) { $ val = parent :: inputVal ( ) ; if ( empty ( $ val ) ) { return '' ; } $ parts = parse_url ( $ val ) ; if ( empty ( $ parts [ 'scheme' ] ) && ! in_array ( $ val [ 0 ] , [ '/' , '#' , '?' ] ) ) { $ path = isset ( $ parts [ 'path' ] ) ? ltrim ( $ parts [ 'path' ] , '/' ) : '' ; $ query =... | Retrieve input value for file preview . |
44,021 | public function dialogTitle ( ) { if ( $ this -> dialogTitle === null ) { $ this -> setDialogTitle ( $ this -> defaultDialogTitle ( ) ) ; } return $ this -> dialogTitle ; } | Retrieve the title for the file picker dialog . |
44,022 | public function chooseButtonLabel ( ) { if ( $ this -> chooseButtonLabel === null ) { $ this -> setChooseButtonLabel ( $ this -> defaultChooseButtonLabel ( ) ) ; } return $ this -> chooseButtonLabel ; } | Retrieve the label for the file picker button . |
44,023 | public function removeButtonLabel ( ) { if ( $ this -> removeButtonLabel === null ) { $ this -> setRemoveButtonLabel ( $ this -> defaultRemoveButtonLabel ( ) ) ; } return $ this -> removeButtonLabel ; } | Retrieve the label for the file removal button . |
44,024 | public function setClassAttr ( $ classes ) { if ( is_array ( $ classes ) ) { $ classes = implode ( ' ' , $ classes ) ; } $ this -> classAttr = $ classes ; return $ this ; } | Set the CSS classes to apply on the image . |
44,025 | public function routes ( ) { $ routes = [ ] ; if ( ! $ this -> config -> get ( 'use_ecomm_sessions' ) ) { return $ routes ; } $ external_registration_path = $ this -> config -> get ( 'external_registration_path' ) ? : '/register' ; $ external_login_path = $ this -> config -> get ( 'external_login_path' ) ? : '/login' ;... | Returns an array of route objects . |
44,026 | public function setInputLayout ( $ layout ) { if ( $ layout === null ) { $ this -> inputLayout = null ; return $ this ; } if ( ! is_string ( $ layout ) ) { throw new InvalidArgumentException ( sprintf ( 'Layout must be a string, received %s' , ( is_object ( $ layout ) ? get_class ( $ layout ) : gettype ( $ layout ) ) )... | Set the property s input layout . |
44,027 | public function inputLayouts ( ) { $ supported = $ this -> supportedInputLayouts ( ) ; $ layouts = [ ] ; foreach ( $ supported as $ layout ) { $ layouts [ $ layout ] = ( $ layout === $ this -> inputLayout ( ) ) ; } return $ layouts ; } | Retrieve the input layouts ; for templating . |
44,028 | public function hasSecondaryMenu ( ) { $ ident = $ this -> ident ( ) ; $ metadata = $ this -> adminSecondaryMenu ( ) ; if ( isset ( $ metadata [ $ ident ] ) ) { return $ this -> hasLinks ( ) || $ this -> hasGroups ( ) || $ this -> hasActions ( ) || $ this -> showTitle ( ) || $ this -> showDescription ( ) ; } return fal... | Determine if the secondary menu has anything . |
44,029 | public function isTabbed ( ) { $ ident = $ this -> ident ( ) ; $ metadata = $ this -> adminSecondaryMenu ( ) ; if ( isset ( $ metadata [ $ ident ] ) ) { return $ this -> hasLinks ( ) || $ this -> hasGroups ( ) || $ this -> hasActions ( ) ; } return false ; } | Determine if the secondary menu is accessible via a tab . |
44,030 | public function adminRoute ( ) { if ( $ this -> adminRoute === null ) { $ requestUri = ( string ) $ this -> httpRequest ( ) -> getUri ( ) ; $ requestUri = str_replace ( $ this -> adminUrl ( ) , '' , $ requestUri ) ; $ this -> adminRoute = $ requestUri ; } return $ this -> adminRoute ; } | Retrieve the current route path . |
44,031 | public function isCurrentItem ( $ linkIdent ) { $ context = array_filter ( [ $ this -> currentItem ( ) , $ this -> objType ( ) , $ this -> adminRoute ( ) , ] ) ; $ matches = array_intersect ( ( array ) $ linkIdent , $ context ) ; return ! ! $ matches ; } | Computes the intersection of values to determine if the link is the current item . |
44,032 | public function title ( ) { if ( $ this -> title === null ) { $ ident = $ this -> ident ( ) ; $ metadata = $ this -> adminSecondaryMenu ( ) ; $ this -> title = '' ; if ( isset ( $ metadata [ $ ident ] [ 'title' ] ) ) { $ this -> setTitle ( $ metadata [ $ ident ] [ 'title' ] ) ; } } return $ this -> title ; } | Retrieve the title of the secondary menu . |
44,033 | public function displayType ( ) { if ( $ this -> displayType === null ) { $ ident = $ this -> ident ( ) ; $ metadata = $ this -> adminSecondaryMenu ( ) ; if ( isset ( $ metadata [ $ ident ] [ 'display_type' ] ) ) { $ this -> setDisplayType ( $ metadata [ $ ident ] [ 'display_type' ] ) ; } else { $ this -> displayType =... | Retrieve the display type of the secondary menu s contents . |
44,034 | public function displayOptions ( ) { if ( $ this -> displayOptions === null ) { $ this -> setDisplayOptions ( $ this -> defaultDisplayOptions ( ) ) ; $ ident = $ this -> ident ( ) ; $ metadata = $ this -> adminSecondaryMenu ( ) ; if ( isset ( $ metadata [ $ ident ] [ 'display_options' ] ) ) { $ options = $ metadata [ $... | Retrieve the display options for the secondary menu . |
44,035 | public function setGroups ( array $ groups ) { $ this -> groups = [ ] ; foreach ( $ groups as $ groupIdent => $ group ) { $ this -> addGroup ( $ groupIdent , $ group ) ; } uasort ( $ this -> groups , [ $ this , 'sortGroupsByPriority' ] ) ; $ this -> groups = array_filter ( $ this -> groups , function ( $ item ) { retur... | Set the secondary menu s groups . |
44,036 | public function addGroup ( $ groupIdent , $ group ) { if ( ! is_string ( $ groupIdent ) ) { throw new InvalidArgumentException ( 'Group identifier must be a string' ) ; } if ( $ group instanceof SecondaryMenuGroupInterface ) { $ group -> setSecondaryMenu ( $ this ) ; $ group -> setIdent ( $ groupIdent ) ; $ this -> gro... | Add a secondary menu group . |
44,037 | public function groups ( ) { if ( $ this -> groups === null ) { $ ident = $ this -> ident ( ) ; $ metadata = $ this -> adminSecondaryMenu ( ) ; $ this -> groups = [ ] ; if ( isset ( $ metadata [ $ ident ] [ 'groups' ] ) ) { $ groups = $ metadata [ $ ident ] [ 'groups' ] ; if ( is_array ( $ groups ) ) { $ this -> setGro... | Retrieve the secondary menu groups . |
44,038 | public function numLinks ( ) { if ( ! is_array ( $ this -> links ( ) ) && ! ( $ this -> links ( ) instanceof \ Traversable ) ) { return 0 ; } $ links = array_filter ( $ this -> links , function ( $ link ) { if ( isset ( $ link [ 'active' ] ) && ! $ link [ 'active' ] ) { return false ; } if ( isset ( $ link [ 'required_... | Count the number of secondary menu links . |
44,039 | public function secondaryMenuActions ( ) { if ( $ this -> secondaryMenuActions === null ) { $ ident = $ this -> ident ( ) ; $ metadata = $ this -> adminSecondaryMenu ( ) ; if ( isset ( $ metadata [ $ ident ] [ 'actions' ] ) ) { $ actions = $ metadata [ $ ident ] [ 'actions' ] ; } else { $ actions = [ ] ; } $ this -> se... | Retrieve the secondary menu s actions . |
44,040 | public function description ( ) { if ( $ this -> description === null ) { $ ident = $ this -> ident ( ) ; $ metadata = $ this -> adminSecondaryMenu ( ) ; $ this -> description = '' ; if ( isset ( $ metadata [ $ ident ] [ 'description' ] ) ) { $ this -> setDescription ( $ metadata [ $ ident ] [ 'description' ] ) ; } } r... | Retrieve the description of the secondary menu . |
44,041 | protected function secondaryMenu ( ) { if ( ! isset ( $ this -> secondaryMenu ) ) { throw new RuntimeException ( sprintf ( 'Secondary Menu Group Factory is not defined for "%s"' , get_class ( $ this ) ) ) ; } return $ this -> secondaryMenu ; } | Retrieve the secondary menu group factory . |
44,042 | protected function setSecondaryMenuActions ( array $ actions ) { $ this -> parsedSecondaryMenuActions = false ; $ this -> secondaryMenuActions = $ this -> mergeActions ( $ this -> defaultSecondaryMenuActions ( ) , $ actions ) ; return $ this ; } | Set the secondary menu s actions . |
44,043 | protected function fillRows ( array $ rows ) { $ row = [ ] ; $ seriesOptions = $ this -> seriesOptions ( ) ; foreach ( $ seriesOptions as $ serieId => $ serieOpts ) { $ row [ $ serieId ] = '0' ; } $ starts = clone ( $ this -> startDate ( ) ) ; $ ends = $ this -> endDate ( ) ; while ( $ starts < $ ends ) { $ x = $ start... | Fill all rows with 0 value for all series when it is unset . |
44,044 | public function get ( $ collection ) { $ storage = $ this -> storageFactory -> get ( "acm.database_store.$collection" ) ; return new DatabaseSessionStore ( $ storage , $ this -> lockBackend , $ this -> currentUser , $ this -> requestStack , $ this -> expire ) ; } | Creates a DatabaseSessionStore . |
44,045 | public function pickerOptions ( ) { if ( $ this -> pickerOptions === null ) { $ this -> pickerOptions = $ this -> defaultPickerOptions ( ) ; } return $ this -> pickerOptions ; } | Retrieve the color picker s options . |
44,046 | public function defaultPickerOptions ( ) { $ date = null ; if ( $ this -> inputVal ( ) !== '' ) { $ date = new \ DateTime ( $ this -> inputVal ( ) ) ; } return [ 'format' => self :: DEFAULT_JS_FORMAT , 'defaultDate' => $ date ? $ date -> format ( \ DateTime :: ISO8601 ) : null ] ; } | Retrieve the default color picker options . |
44,047 | protected function debugLogger ( string $ message , array $ context = [ ] ) { if ( $ this -> debug ) { $ this -> logger -> debug ( $ message , $ context ) ; } } | Write to the log only if the debug flag is set true . |
44,048 | public function getToken ( ) { $ cid = 'acm_payment:braintree_token' ; $ token = NULL ; if ( $ cache = \ Drupal :: cache ( ) -> get ( $ cid ) ) { $ token = $ cache -> data ; } else { $ token = \ Drupal :: service ( 'acm.api' ) -> getPaymentToken ( 'braintree' ) ; \ Drupal :: cache ( ) -> set ( $ cid , $ token ) ; } ret... | Get and cache the token used for a transaction . |
44,049 | protected function processStepId ( $ requested_step_id ) { $ cart = $ this -> cartStorage ; if ( $ cart -> isEmpty ( ) ) { throw new NeedsRedirectException ( Url :: fromRoute ( 'acm_cart.cart' ) -> toString ( ) ) ; } $ cart_step_id = $ cart -> getCheckoutStep ( ) ; $ step_ids = array_keys ( $ this -> getVisibleSteps ( ... | Processes the requested step ID . |
44,050 | protected function actions ( array $ form , FormStateInterface $ form_state ) { $ steps = $ this -> getVisibleSteps ( ) ; $ next_step_id = $ this -> getNextStepId ( ) ; $ previous_step_id = $ this -> getPreviousStepId ( ) ; $ has_next_step = $ next_step_id && isset ( $ steps [ $ next_step_id ] [ 'next_label' ] ) ; $ ha... | Builds the actions element for the current form . |
44,051 | public function addEditButton ( array & $ field , $ field_name ) { $ field [ '#buttons' ] [ 'edit' ] = [ '#type' => 'link' , '#title' => $ this -> t ( 'Edit' ) , '#url' => Url :: fromRoute ( 'acm_customer.view_page' , [ 'page' => $ this -> getPageId ( ) , 'action' => 'edit' , 'id' => $ field_name , ] ) , '#attributes' ... | Adds an edit button to a form field . |
44,052 | public function addSaveButtons ( array & $ field , $ field_name ) { $ field [ '#display_value' ] = FALSE ; $ field [ '#buttons' ] [ 'cancel' ] = [ '#type' => 'link' , '#title' => $ this -> t ( 'Cancel' ) , '#url' => Url :: fromRoute ( 'acm_customer.view_page' , [ 'page' => $ this -> getPageId ( ) , ] ) , '#attributes' ... | Adds a save and cancel button to a form field . |
44,053 | public function init ( RequestInterface $ request ) { if ( ! session_id ( ) ) { session_cache_limiter ( false ) ; session_start ( ) ; } $ this -> setDataFromRequest ( $ request ) ; $ this -> authRedirect ( $ request ) ; return parent :: init ( $ request ) ; } | Action s init method is called automatically from charcoal - app s Action Route . |
44,054 | public function recaptchaEnabled ( ) { $ recaptcha = $ this -> apiConfig ( 'google.recaptcha' ) ; if ( empty ( $ recaptcha ) || ( isset ( $ recaptcha [ 'active' ] ) && $ recaptcha [ 'active' ] === false ) ) { return false ; } return ( ! empty ( $ recaptcha [ 'public_key' ] ) || ! empty ( $ recaptcha [ 'key' ] ) ) && ( ... | Determine if a CAPTCHA test is available . |
44,055 | public function recaptchaSecretKey ( ) { $ recaptcha = $ this -> apiConfig ( 'google.recaptcha' ) ; if ( ! empty ( $ recaptcha [ 'private_key' ] ) ) { return $ recaptcha [ 'private_key' ] ; } elseif ( ! empty ( $ recaptcha [ 'secret' ] ) ) { return $ recaptcha [ 'secret' ] ; } return null ; } | Retrieve the Google reCAPTCHA secret key . |
44,056 | protected function validateCaptcha ( $ token ) { if ( empty ( $ token ) ) { throw new RuntimeException ( 'Google reCAPTCHA response parameter is invalid or malformed.' ) ; } $ secret = $ this -> recaptchaSecretKey ( ) ; if ( empty ( $ secret ) ) { throw new RuntimeException ( 'Google reCAPTCHA [apis.google.recaptcha.pr... | Validate a Google reCAPTCHA user response . |
44,057 | protected function validateCaptchaFromRequest ( RequestInterface $ request , ResponseInterface & $ response = null ) { $ token = $ request -> getParam ( 'g-recaptcha-response' , false ) ; if ( empty ( $ token ) ) { if ( $ response !== null ) { $ this -> addFeedback ( 'error' , $ this -> translator ( ) -> translate ( 'M... | Validate a Google reCAPTCHA user response from a PSR Request object . |
44,058 | public function resetPass ( $ email , $ timestamp , $ hash ) { $ this -> session -> set ( 'pass_reset_hash' , $ hash ) ; $ this -> session -> set ( 'pass_reset_timeout' , $ timestamp ) ; return $ this -> redirect ( 'acm.external_user_password_reset_form' , [ 'email' => $ email ] ) ; } | Redirects to the user password reset form . |
44,059 | public function getResetPassForm ( $ email ) { $ timestamp = $ this -> session -> get ( 'pass_reset_timeout' ) ; $ hash = $ this -> session -> get ( 'pass_reset_hash' ) ; $ this -> session -> remove ( 'pass_reset_timeout' ) ; $ this -> session -> remove ( 'pass_reset_hash' ) ; if ( ! $ hash || ! $ timestamp ) { throw n... | Returns the user password reset form . |
44,060 | public function resetPassLogin ( Request $ request , $ email , $ timestamp , $ hash ) { $ user = NULL ; $ email = base64_decode ( $ email ) ; try { $ user = $ this -> apiWrapper -> getCustomer ( $ email ) ; } catch ( \ Exception $ e ) { } if ( ! $ user ) { throw new AccessDeniedHttpException ( ) ; } $ account = new Com... | Reset password and log in . |
44,061 | public function setSelectizeOptions ( array $ settings ) { $ this -> selectizeOptions = array_merge ( $ this -> defaultSelectizeOptions ( ) , $ this -> parseSelectizeOptions ( $ settings ) ) ; return $ this ; } | Set the selectize picker s options . |
44,062 | public function selectizeOptions ( ) { if ( $ this -> selectizeOptions === null ) { $ this -> selectizeOptions = $ this -> defaultSelectizeOptions ( ) ; } return $ this -> selectizeOptions ; } | Retrieve the selectize picker s options . |
44,063 | public function isSelected ( $ flag = null ) { if ( $ flag !== null ) { $ this -> isSelected = ! ! $ flag ; $ this -> setCollapsed ( ! $ flag ) ; } return $ this -> isSelected ; } | Set whether the item is selected or not . |
44,064 | public function collapsed ( ) { $ collapsed = $ this -> collapsible ( ) ; if ( is_bool ( $ this -> collapsed ) ) { $ collapsed = $ this -> collapsed ; } if ( is_bool ( $ this -> isSelected ( ) ) ) { $ collapsed = ! $ this -> isSelected ; } return $ collapsed ; } | Determine if the group is collapsed . |
44,065 | public function buildAttributeRow ( $ key , array $ group = [ ] ) { $ weight = isset ( $ group [ 'weight' ] ) ? $ group [ 'weight' ] : 0 ; $ row = [ ] ; $ row [ 'enabled' ] = [ '#type' => 'checkbox' , '#default_value' => isset ( $ group [ 'enabled' ] ) ? $ group [ 'enabled' ] : 0 , ] ; $ row [ 'name' ] = [ '#plain_text... | Builds a row for the attributes form . |
44,066 | public function getConfiguredOptions ( SKU $ child ) { $ sku_type = SKUType :: load ( $ this -> getPluginDefinition ( ) [ 'id' ] ) ; $ groups = $ sku_type -> getThirdPartySetting ( 'acm_sku__variant' , 'attribute_groups' , [ ] ) ; $ configured_options = [ ] ; $ attributes = $ child -> attributes -> getValue ( ) ; forea... | Get the configured options for this SKU instance . |
44,067 | protected function db ( ) { if ( ! isset ( $ this -> database ) ) { throw new RuntimeException ( sprintf ( 'Database Connection is not defined for "%s"' , get_class ( $ this ) ) ) ; } return $ this -> database ; } | Retrieve the database connection . |
44,068 | protected function adminAcl ( ) { if ( ! isset ( $ this -> aclManager ) ) { throw new RuntimeException ( sprintf ( 'ACL Manager is not defined for "%s"' , get_class ( $ this ) ) ) ; } return $ this -> aclManager ; } | Retrieve the ACL manager . |
44,069 | protected function modelFactory ( ) { if ( $ this -> modelFactory === null ) { throw new Exception ( sprintf ( 'Model Factory is not defined for "%s"' , get_class ( $ this ) ) ) ; } return $ this -> modelFactory ; } | Model Factory getter . |
44,070 | public function collectionIdentFallback ( ) { $ metadata = $ this -> proto ( ) -> metadata ( ) ; if ( isset ( $ metadata [ 'admin' ] [ 'default_list' ] ) ) { return $ metadata [ 'admin' ] [ 'default_list' ] ; } return $ this -> collectionIdent ; } | Retrieve a key for the collection structure to use . |
44,071 | public function collectionMetadata ( ) { $ proto = $ this -> proto ( ) ; $ collectionIdent = $ this -> collectionIdent ( ) ; if ( ! $ collectionIdent ) { $ collectionIdent = $ this -> collectionIdentFallback ( ) ; } if ( $ collectionIdent && $ proto -> view ( ) ) { $ collectionIdent = $ proto -> render ( $ collectionId... | Return the current collection metadata . |
44,072 | public function collectionConfig ( ) { if ( $ this -> collectionConfig === null ) { $ this -> collectionConfig = $ this -> createCollectionConfig ( ) ; } return $ this -> collectionConfig ; } | Retrieve the collection configset . |
44,073 | public function setCollectionConfig ( $ config ) { if ( empty ( $ config ) || ! is_array ( $ config ) ) { $ config = [ ] ; } $ this -> collectionConfig = array_replace_recursive ( $ this -> defaultCollectionConfig ( ) , $ this -> parseCollectionConfig ( $ config ) ) ; return $ this ; } | Replace the collection s configset with the given parameters . |
44,074 | public function mergeCollectionConfig ( array $ config ) { if ( $ this -> collectionConfig === null ) { $ this -> setCollectionConfig ( $ config ) ; return $ this ; } $ this -> collectionConfig = array_replace_recursive ( $ this -> defaultCollectionConfig ( ) , $ this -> collectionConfig , $ this -> parseCollectionConf... | Merge given parameters into the collection s configset . |
44,075 | protected function defaultCollectionConfig ( ) { if ( $ this -> defaultCollectionConfig === null ) { $ this -> defaultCollectionConfig = $ this -> collectionMetadata ( ) ; } return $ this -> defaultCollectionConfig ; } | Retrieve the default collection configuration . |
44,076 | public function objectRows ( ) { $ properties = $ this -> sortProperties ( ) ; $ propOptions = $ this -> propertiesOptions ( ) ; $ objects = $ this -> sortObjects ( ) ; foreach ( $ objects as $ object ) { if ( isset ( $ object [ 'requiredAclPermissions' ] ) && ! empty ( $ object [ 'requiredAclPermissions' ] ) ) { if ( ... | Supplies properties for objects in table template specific to object configuration . |
44,077 | public function objLabels ( ) { if ( $ this -> objLabels === null ) { $ objLabels = [ ] ; $ proto = $ this -> proto ( ) ; $ objMetadata = $ proto -> metadata ( ) ; if ( isset ( $ objMetadata [ 'labels' ] ) && ! empty ( $ objMetadata [ 'labels' ] ) ) { $ objLabels = $ objMetadata [ 'labels' ] ; array_walk ( $ objLabels ... | Retrieve the object s labels . |
44,078 | public function editorOptions ( ) { if ( $ this -> editorOptions === null ) { $ this -> editorOptions = $ this -> defaultEditorOptions ( ) ; } return $ this -> editorOptions ; } | Retrieve the editor s options . |
44,079 | public function jsonVal ( ) { $ json = $ this -> propertyVal ( ) ; if ( ! is_string ( $ json ) ) { $ json = json_encode ( $ json ) ; } if ( ! $ json || $ json == 'null' ) { $ json = '' ; } return $ json ; } | Retrieve the property s value as a json encoded string . |
44,080 | public function setupElfinder ( array $ extraOptions = [ ] ) { if ( ! defined ( 'ELFINDER_IMG_PARENT_URL' ) ) { define ( 'ELFINDER_IMG_PARENT_URL' , $ this -> baseUrl ( ElfinderTemplate :: ELFINDER_ASSETS_REL_PATH ) ) ; } $ options = $ this -> buildConnectorOptions ( $ extraOptions ) ; $ connector = new elFinderConnect... | Setup the elFinder connector . |
44,081 | public function getConnectorOptions ( ) { if ( $ this -> elfinderOptions === null ) { $ this -> elfinderOptions = $ this -> buildConnectorOptions ( ) ; } return $ this -> elfinderOptions ; } | Retrieve the elFinder Connector options . |
44,082 | public function buildConnectorOptions ( array $ extraOptions = [ ] ) { $ options = [ 'debug' => false , 'roots' => $ this -> getCurrentRoots ( ) ] ; $ adminOptions = $ this -> getAdminConnectorOptions ( ) ; $ adminOptions = $ this -> parseAdminOptionsForConnectorBuild ( $ adminOptions ) ; $ extraOptions = $ this -> par... | Build and retrieve the elFinder Connector options . |
44,083 | public function getNamedRoot ( $ ident ) { if ( $ this -> hasFilesystem ( $ ident ) === false ) { return null ; } $ filesystem = $ this -> getFilesystem ( $ ident ) ; $ fsConfig = $ this -> getFilesystemConfig ( $ ident ) ; $ elfConfig = $ this -> getFilesystemAdminConfig ( $ ident ) ; if ( isset ( $ elfConfig [ 'label... | Retrieve the elFinder root options for the given file system . |
44,084 | public function getPublicRoots ( ) { $ roots = [ ] ; foreach ( $ this -> filesystems -> keys ( ) as $ ident ) { if ( $ this -> isFilesystemPublic ( $ ident ) ) { $ disk = $ this -> getNamedRoot ( $ ident ) ; if ( $ disk !== null ) { $ roots [ $ ident ] = $ disk ; } } } return $ roots ; } | Retrieve only the public elFinder root volumes . |
44,085 | public function getAllRoots ( ) { $ roots = [ ] ; foreach ( $ this -> filesystems -> keys ( ) as $ ident ) { $ disk = $ this -> getNamedRoot ( $ ident ) ; if ( $ disk !== null ) { $ roots [ $ ident ] = $ disk ; } } return $ roots ; } | Retrieve all elFinder root volumes . |
44,086 | public function getCurrentRoots ( ) { $ formProperty = $ this -> formProperty ( ) ; $ targetFilesystem = $ formProperty ? $ formProperty -> filesystem ( ) : null ; if ( $ this -> hasFilesystem ( $ targetFilesystem ) ) { $ disk = $ this -> getNamedRoot ( $ targetFilesystem ) ; $ startPath = $ formProperty -> uploadPath ... | Retrieve only the current context s elFinder root volumes . |
44,087 | protected function resolveCallbacksForRoots ( array $ roots ) { foreach ( $ roots as $ i => $ root ) { $ roots [ $ i ] = $ this -> resolveCallbacksForRoot ( $ root ) ; } return $ roots ; } | Resolve callables in a collection of elFinder s root volumes . |
44,088 | protected function resolveCallbacksForRoot ( array $ root ) { if ( isset ( $ root [ 'accessControl' ] ) ) { $ callable = $ root [ 'accessControl' ] ; if ( ! is_callable ( $ callable ) && is_string ( $ callable ) ) { $ root [ 'accessControl' ] = $ this -> resolveCallable ( $ callable ) ; } } return $ root ; } | Resolve callables in one elFinder root volume . |
44,089 | protected function resolveCallbacksForBindOption ( array $ toResolve ) { $ resolved = $ toResolve ; foreach ( $ toResolve as $ actions => $ callables ) { foreach ( $ callables as $ i => $ callable ) { if ( ! is_callable ( $ callable ) && is_string ( $ callable ) ) { if ( 0 === strpos ( $ callable , 'Plugin.' ) ) { cont... | Resolve callables in elFinder s bind option . |
44,090 | public function sanitizeOnUploadPreSave ( & $ path , & $ name , $ src , $ elfinder , $ volume ) { unset ( $ path , $ src , $ elfinder , $ volume ) ; if ( isset ( $ this -> elfinderOptions [ 'plugin' ] [ 'Sanitizer' ] ) ) { $ opts = $ this -> elfinderOptions [ 'plugin' ] [ 'Sanitizer' ] ; if ( isset ( $ opts [ 'enable' ... | Trim a file name . |
44,091 | public function checkAccess ( $ attr , $ path , $ data , elFinderVolumeDriver $ volume , $ isDir , $ relPath ) { unset ( $ data , $ volume , $ isDir ) ; $ basename = basename ( $ path ) ; return ( $ basename [ 0 ] === '.' && strlen ( $ relPath ) !== 1 ) ? ! ( $ attr === 'read' || $ attr === 'write' ) : null ; } | Control file access . |
44,092 | protected function getFilesystem ( $ ident ) { if ( isset ( $ this -> filesystems [ $ ident ] ) ) { return $ this -> filesystems [ $ ident ] ; } return null ; } | Get the named filesystem object . |
44,093 | protected function getFilesystemConfig ( $ ident ) { if ( $ this -> hasFilesystem ( $ ident ) === false ) { return null ; } if ( isset ( $ this -> filesystemConfig [ 'connections' ] [ $ ident ] ) ) { return $ this -> filesystemConfig [ 'connections' ] [ $ ident ] ; } return [ ] ; } | Get the given filesystem s storage configset . |
44,094 | protected function getFilesystemAdminConfig ( $ ident ) { if ( $ this -> hasFilesystem ( $ ident ) === false ) { return null ; } $ elfConfig = $ this -> getAdminConnectorOptions ( ) ; if ( isset ( $ elfConfig [ 'roots' ] [ $ ident ] ) ) { return $ elfConfig [ 'roots' ] [ $ ident ] ; } return [ ] ; } | Get the given filesystem s admin configset . |
44,095 | protected function elfinderConfig ( $ key = null , $ default = null ) { if ( $ key ) { if ( isset ( $ this -> elfinderConfig [ $ key ] ) ) { return $ this -> elfinderConfig [ $ key ] ; } else { if ( ! is_string ( $ default ) && is_callable ( $ default ) ) { return $ default ( ) ; } else { return $ default ; } } } retur... | Retrieve the elFinder s configset . |
44,096 | public function syncPromotions ( $ types = [ 'category' , 'cart' ] ) { $ types = is_array ( $ types ) ? $ types : [ $ types ] ; $ ids = [ ] ; $ fetched_promotions = [ ] ; foreach ( $ types as $ type ) { $ promotions = $ this -> apiWrapper -> getPromotions ( $ type ) ; foreach ( $ promotions as $ key => $ promotion ) { ... | Synchronize promotions through the API . |
44,097 | protected function deletePromotions ( array $ types , array $ validIDs = [ ] ) { $ query = $ this -> nodeStorage -> getQuery ( ) ; $ query -> condition ( 'type' , 'acm_promotion' ) ; $ query -> condition ( 'field_acm_promotion_type' , $ types , 'IN' ) ; if ( $ validIDs ) { $ query -> condition ( 'field_acm_promotion_ru... | Delete Promotion nodes not part of API Response . |
44,098 | public function getPromotionByRuleId ( $ rule_id , $ rule_type ) { $ query = $ this -> nodeStorage -> getQuery ( ) ; $ query -> condition ( 'type' , 'acm_promotion' ) ; $ query -> condition ( 'field_acm_promotion_rule_id' , $ rule_id ) ; $ query -> condition ( 'field_acm_promotion_type' , $ rule_type ) ; $ nids = $ que... | Helper function to fetch promotion node given rule id . |
44,099 | public function getSkusForPromotion ( NodeInterface $ promotion ) { $ query = $ this -> connection -> select ( 'acm_sku__field_acm_sku_promotions' , 'fasp' ) ; if ( \ Drupal :: entityTypeManager ( ) -> getDefinition ( 'acm_sku' ) -> isTranslatable ( ) ) { $ query -> join ( 'acm_sku_field_data' , 'asfd' , 'asfd.id = fas... | Helper function to get skus attached with a promotion . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.