idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
15,500 | public function make ( array $ config ) { Arr :: requires ( $ config , [ 'token' ] ) ; $ client = new Client ( ) ; return new GitterGateway ( $ client , $ config ) ; } | Create a new gitter gateway instance . |
15,501 | public function getPriceOffsets ( ) { $ currencyOffsets = SaleOffsetCurrencyQuery :: create ( ) -> filterBySaleId ( $ this -> getId ( ) ) -> find ( ) ; $ offsetList = [ ] ; foreach ( $ currencyOffsets as $ currencyOffset ) { $ offsetList [ $ currencyOffset -> getCurrencyId ( ) ] = $ currencyOffset -> getPriceOffsetValu... | Get the price offsets for each of the currencies . |
15,502 | public function getSaleProductList ( ) { $ saleProducts = SaleProductQuery :: create ( ) -> filterBySaleId ( $ this -> getId ( ) ) -> groupByProductId ( ) -> find ( ) ; return $ saleProducts ; } | Return the products included in this sale . |
15,503 | public function getSaleProductsAttributeList ( ) { $ saleProducts = SaleProductQuery :: create ( ) -> filterBySaleId ( $ this -> getId ( ) ) -> orderByProductId ( ) -> find ( ) ; $ selectedAttributes = [ ] ; $ currentProduct = false ; foreach ( $ saleProducts as $ saleProduct ) { if ( $ currentProduct != $ saleProduct ... | Return the selected attributes values for each of the selected products . |
15,504 | public function noAction ( Request $ request ) { $ view = null ; if ( ! $ view = $ request -> query -> get ( 'view' ) ) { if ( $ request -> request -> has ( 'view' ) ) { $ view = $ request -> request -> get ( 'view' ) ; } } if ( null !== $ view ) { $ request -> attributes -> set ( '_view' , $ view ) ; } if ( null === $... | This is the default Thelia behaviour if no action is defined . |
15,505 | public function isMatching ( ConditionCollection $ conditions ) { $ isMatching = true ; foreach ( $ conditions as $ condition ) { if ( ! $ condition -> isMatching ( ) ) { return false ; } } return $ isMatching ; } | Check if an Event matches SerializableCondition |
15,506 | public function variableOpComparison ( $ v1 , $ o , $ v2 ) { switch ( $ o ) { case Operators :: DIFFERENT : return ( $ v1 != $ v2 ) ; case Operators :: SUPERIOR : return ( $ v1 > $ v2 ) ; case Operators :: SUPERIOR_OR_EQUAL : return ( $ v1 >= $ v2 ) ; case Operators :: INFERIOR : return ( $ v1 < $ v2 ) ; case Operators... | Do variable comparison |
15,507 | public function getArgument ( $ key , $ default = null ) { return array_key_exists ( $ key , $ this -> arguments ) ? $ this -> arguments [ $ key ] : $ default ; } | Get an argument |
15,508 | public function getTemplateVar ( $ templateVariableName ) { if ( ! isset ( $ this -> templateVars [ $ templateVariableName ] ) ) { throw new \ InvalidArgumentException ( sprintf ( "Template variable '%s' is not defined." , $ templateVariableName ) ) ; } return $ this -> templateVars [ $ templateVariableName ] ; } | Return a template variable value . An exception is thorwn if the variable is not defined . |
15,509 | public function sanitizeValue ( ) { $ strColNameId = $ this -> objAttribute -> get ( 'tag_id' ) ? : 'id' ; $ strColNameAlias = $ this -> objAttribute -> get ( 'tag_alias' ) ; $ arrValues = \ is_array ( $ this -> value ) ? $ this -> value : \ explode ( ',' , $ this -> value ) ; if ( ! $ this -> isMetaModel ( ) ) { if ( ... | Ensure the value is either a proper id or array od ids - converts aliases to ids . |
15,510 | public function make ( array $ config ) { if ( ! isset ( $ config [ 'driver' ] ) ) { throw new InvalidArgumentException ( 'A driver must be specified.' ) ; } return $ this -> factory ( $ config [ 'driver' ] ) -> make ( $ config ) ; } | Create a new gateway instance . |
15,511 | public function factory ( $ name ) { if ( isset ( $ this -> factories [ $ name ] ) ) { return $ this -> factories [ $ name ] ; } if ( class_exists ( $ class = $ this -> inflect ( $ name ) ) ) { return $ this -> factories [ $ name ] = new $ class ( ) ; } throw new InvalidArgumentException ( "Unsupported factory [$name].... | Get a factory instance by name . |
15,512 | public function getRoot ( $ categoryId ) { $ category = CategoryQuery :: create ( ) -> findPk ( $ categoryId ) ; if ( 0 !== $ category -> getParent ( ) ) { $ parentCategory = CategoryQuery :: create ( ) -> findPk ( $ category -> getParent ( ) ) ; if ( null !== $ parentCategory ) { $ categoryId = $ this -> getRoot ( $ p... | Get the root category |
15,513 | public function addRemoteFile ( string $ file , string $ locale = null ) : self { $ collection = $ this -> getCollection ( $ this -> getType ( $ file ) , $ locale ) ; $ collection -> addRemoteFile ( $ file ) ; return $ this ; } | Prida remote soubor |
15,514 | public function createCssLoader ( ) : CssLoader { $ compiler = Compiler :: createCssCompiler ( $ this -> files [ self :: CSS ] [ null ] , $ this -> wwwDir . '/' . $ this -> outputDir ) ; foreach ( $ this -> filters [ self :: CSS ] as $ filter ) { $ compiler -> addFileFilter ( $ filter ) ; } return new CssLoader ( $ com... | Vytvori komponentu css |
15,515 | public function createJavaScriptLoader ( string $ locale = null ) : JavaScriptLoader { $ compilers [ ] = $ this -> createJSCompiler ( $ this -> files [ self :: JS ] [ null ] ) ; if ( $ locale !== null && isset ( $ this -> files [ self :: JS ] [ $ locale ] ) ) { $ compilers [ ] = $ this -> createJSCompiler ( $ this -> f... | Vytvori komponentu js |
15,516 | private function getCollection ( string $ type , string $ locale = null ) : FileCollection { if ( ! isset ( $ this -> files [ $ type ] [ $ locale ] ) ) { $ this -> files [ $ type ] [ $ locale ] = new FileCollection ( $ this -> root ) ; } return $ this -> files [ $ type ] [ $ locale ] ; } | Vrati kolekci souboru |
15,517 | private function getType ( string $ file ) : string { $ css = '/\.(css|less)$/' ; $ js = '/\.js$/' ; if ( preg_match ( $ css , $ file ) ) { return self :: CSS ; } elseif ( preg_match ( $ js , $ file ) ) { return self :: JS ; } throw new InvalidArgumentException ( "Unknown assets file '$file'" ) ; } | Vrati typ souboru |
15,518 | protected function getDefaultCategoryId ( $ product ) { $ defaultCategoryId = null ; if ( ( bool ) $ product -> getVirtualColumn ( 'is_default_category' ) ) { $ defaultCategoryId = $ product -> getVirtualColumn ( 'default_category_id' ) ; } else { $ defaultCategoryId = $ product -> getDefaultCategoryId ( ) ; } return $... | Get the default category id for a product |
15,519 | protected function createComponentPasswordForm ( ) : Form { $ form = $ this -> formFactory -> create ( ) ; $ form -> setAjaxRequest ( ) ; $ form -> addPassword ( 'oldPassword' , 'cms.user.oldPassword' ) -> setRequired ( ) ; $ form -> addPassword ( 'password' , 'cms.user.newPassword' ) -> setRequired ( ) -> addRule ( Fo... | Formular zmeny hesla |
15,520 | public function create ( ProductSaleElementCreateEvent $ event ) { $ con = Propel :: getWriteConnection ( ProductSaleElementsTableMap :: DATABASE_NAME ) ; $ con -> beginTransaction ( ) ; try { $ salesElement = ProductSaleElementsQuery :: create ( ) -> filterByProductId ( $ event -> getProduct ( ) -> getId ( ) ) -> join... | Create a new product sale element with or without combination |
15,521 | public function update ( ProductSaleElementUpdateEvent $ event ) { $ salesElement = ProductSaleElementsQuery :: create ( ) -> findPk ( $ event -> getProductSaleElementId ( ) ) ; $ con = Propel :: getWriteConnection ( ProductSaleElementsTableMap :: DATABASE_NAME ) ; $ con -> beginTransaction ( ) ; try { $ event -> getPr... | Update an existing product sale element |
15,522 | public function delete ( ProductSaleElementDeleteEvent $ event ) { if ( null !== $ pse = ProductSaleElementsQuery :: create ( ) -> findPk ( $ event -> getProductSaleElementId ( ) ) ) { $ product = $ pse -> getProduct ( ) ; $ con = Propel :: getWriteConnection ( ProductSaleElementsTableMap :: DATABASE_NAME ) ; $ con -> ... | Delete a product sale element |
15,523 | public function generateCombinations ( ProductCombinationGenerationEvent $ event ) { $ con = Propel :: getWriteConnection ( ProductSaleElementsTableMap :: DATABASE_NAME ) ; $ con -> beginTransaction ( ) ; try { ProductSaleElementsQuery :: create ( ) -> filterByProductId ( $ event -> product -> getId ( ) ) -> delete ( )... | Generate combinations . All existing combinations for the product are deleted . |
15,524 | protected function createCombination ( ConnectionInterface $ con , ProductSaleElements $ salesElement , $ combinationAttributes ) { foreach ( $ combinationAttributes as $ attributeAvId ) { $ attributeAv = AttributeAvQuery :: create ( ) -> findPk ( $ attributeAvId ) ; if ( $ attributeAv !== null ) { $ attributeCombinati... | Create a combination for a given product sale element |
15,525 | public function clonePSE ( ProductCloneEvent $ event ) { $ clonedProduct = $ event -> getClonedProduct ( ) ; $ originalProductPSEs = ProductSaleElementsQuery :: create ( ) -> orderByIsDefault ( Criteria :: DESC ) -> findByProductId ( $ event -> getOriginalProduct ( ) -> getId ( ) ) ; foreach ( $ originalProductPSEs as ... | Clone product s PSEs and associated datas |
15,526 | public function getCustomerLang ( ) { $ lang = $ this -> getLangModel ( ) ; if ( $ lang === null ) { $ lang = ( new LangQuery ) -> filterByByDefault ( 1 ) -> findOne ( ) ; } return $ lang ; } | Return the customer lang or the default one if none is defined . |
15,527 | public function setPassword ( $ password ) { if ( $ this -> isNew ( ) && ( $ password === null || trim ( $ password ) == "" ) ) { throw new InvalidArgumentException ( "customer password is mandatory on creation" ) ; } if ( $ password !== null && trim ( $ password ) != "" ) { $ this -> setAlgo ( "PASSWORD_BCRYPT" ) ; pa... | create hash for plain password and set it in Customer object |
15,528 | public function getDownloadUrl ( ) { $ url = Configs :: get ( 'api' ) . '/v1/plugins/' . $ this -> slug . '/download' ; $ url = add_query_arg ( 'key' , Configs :: get ( 'key' ) , $ url ) ; return $ url ; } | Return the download url for a plugin . |
15,529 | protected function createComponentUploadForm ( ) : Form { $ form = $ this -> formFactory -> create ( ) ; $ form -> addUpload ( 'sql' , 'cms.database.file' ) -> setRequired ( ) ; $ form -> addSubmit ( 'upload' , 'cms.database.upload' ) ; $ form -> onSuccess [ ] = [ $ this , 'uploadFormSucceeded' ] ; return $ form ; } | Formular nahrani databaze |
15,530 | public static function getSolrType ( ) { $ relationships = PlatformAppConfig :: get ( 'relationships' ) ; if ( ! isset ( $ relationships [ 'solr' ] ) ) { return FALSE ; } list ( $ solr_key , ) = explode ( ':' , $ relationships [ 'solr' ] ) ; $ solr_config = self :: get ( $ solr_key ) ; if ( ! isset ( $ solr_config [ 't... | Gets the solr type . |
15,531 | public static function getSolrMajorVersion ( ) { $ type = static :: getSolrType ( ) ; $ version = FALSE ; if ( $ type ) { list ( , $ version ) = explode ( ":" , $ type ) ; if ( preg_match ( '/^(\d)\./' , $ version , $ matches ) ) { $ version = $ matches [ 1 ] ; } else { $ version = '4' ; } if ( $ version === '3' ) { $ ... | Gets the solr major version |
15,532 | public function getArchivers ( $ isAvailable = null ) { if ( $ isAvailable === null ) { return $ this -> archivers ; } $ filteredArchivers = [ ] ; foreach ( $ this -> archivers as $ archiver ) { if ( $ archiver -> isAvailable ( ) === ( bool ) $ isAvailable ) { $ filteredArchivers [ ] = $ archiver ; } } return $ filtere... | Get all archivers or only those match availability |
15,533 | public function get ( $ archiverId , $ isAvailable = null ) { $ this -> has ( $ archiverId , true ) ; if ( $ isAvailable === null ) { return $ this -> archivers [ $ archiverId ] ; } if ( $ this -> archivers [ $ archiverId ] -> isAvailable ( ) === ( bool ) $ isAvailable ) { return $ this -> archivers [ $ archiverId ] ; ... | Get an archiver |
15,534 | protected function getMessageBody ( $ parser , $ message , $ layout , $ template , $ compressOutput = true ) { $ body = false ; if ( ! empty ( $ template ) ) { try { $ body = $ parser -> render ( $ template , [ ] , $ compressOutput ) ; } catch ( ResourceNotFoundException $ ex ) { Tlog :: getInstance ( ) -> addError ( "... | Calculate the message body given the HTML entered in the back - office the message layout and the message template |
15,535 | public function getHtmlMessageBody ( ParserInterface $ parser ) { return $ this -> getMessageBody ( $ parser , $ this -> getHtmlMessage ( ) , $ this -> getHtmlLayoutFileName ( ) , $ this -> getHtmlTemplateFileName ( ) ) ; } | Get the HTML message body |
15,536 | public function getTextMessageBody ( ParserInterface $ parser ) { $ message = $ this -> getMessageBody ( $ parser , $ this -> getTextMessage ( ) , $ this -> getTextLayoutFileName ( ) , $ this -> getTextTemplateFileName ( ) , true ) ; return preg_replace ( "/<br>/i" , "\n" , $ message ) ; } | Get the TEXT message body |
15,537 | public function buildMessage ( ParserInterface $ parser , \ Swift_Message $ messageInstance , $ useFallbackTemplate = true ) { $ parser -> pushTemplateDefinition ( $ parser -> getTemplateHelper ( ) -> getActiveMailTemplate ( ) , $ useFallbackTemplate ) ; $ subject = $ parser -> renderString ( $ this -> getSubject ( ) )... | Add a subject and a body ( TEXT HTML or both depending on the message configuration . |
15,538 | public function renderPlatformModalContentAction ( ) { $ pids_id = $ this -> params ( ) -> fromQuery ( 'id' ) ; $ melisMelisCoreConfig = $ this -> serviceLocator -> get ( 'MelisCoreConfig' ) ; $ genericPlatformForm = $ melisMelisCoreConfig -> getFormMergedAndOrdered ( 'meliscms/tools/meliscms_platform_tool/forms/melisc... | Render Platform Content Modal |
15,539 | public function getPlatformList ( ) { $ success = 0 ; $ data = array ( ) ; if ( $ this -> getRequest ( ) -> isPost ( ) ) { $ success = 0 ; $ platform = $ this -> getServiceLocator ( ) -> get ( "Melisplatform" ) ; $ data = $ platform -> getPlatformList ( ) ; } return $ data ; } | Return list of platform |
15,540 | public function getExport ( $ exportId , $ dispatchException = false ) { $ export = ( new ExportQuery ) -> findPk ( $ exportId ) ; if ( $ export === null && $ dispatchException ) { throw new \ ErrorException ( Translator :: getInstance ( ) -> trans ( 'There is no id "%id" in the exports' , [ '%id' => $ exportId ] ) ) ;... | Get export model based on given identifier |
15,541 | public function getExportByRef ( $ exportRef , $ dispatchException = false ) { $ export = ( new ExportQuery ) -> findOneByRef ( $ exportRef ) ; if ( $ export === null && $ dispatchException ) { throw new \ ErrorException ( Translator :: getInstance ( ) -> trans ( 'There is no ref "%ref" in the exports' , [ '%ref' => $ ... | Get export model based on given reference |
15,542 | public function getCategory ( $ exportCategoryId , $ dispatchException = false ) { $ category = ( new ExportCategoryQuery ) -> findPk ( $ exportCategoryId ) ; if ( $ category === null && $ dispatchException ) { throw new \ ErrorException ( Translator :: getInstance ( ) -> trans ( 'There is no id "%id" in the export cat... | Get export category model based on given identifier |
15,543 | protected function processExportImages ( AbstractExport $ export , ArchiverInterface $ archiver ) { foreach ( $ export -> getImagesPaths ( ) as $ imagePath ) { $ archiver -> add ( $ imagePath ) ; } } | Add images to archive |
15,544 | protected function processExportDocuments ( AbstractExport $ export , ArchiverInterface $ archiver ) { foreach ( $ export -> getDocumentsPaths ( ) as $ documentPath ) { $ archiver -> add ( $ documentPath ) ; } } | Add documents to archive |
15,545 | protected function configureI18nProcessing ( ModelCriteria $ search , $ columns = array ( 'TITLE' , 'CHAPO' , 'DESCRIPTION' , 'POSTSCRIPTUM' ) , $ foreignTable = null , $ foreignKey = 'ID' , $ forceReturn = false ) { $ this -> locale = ModelCriteriaTools :: getI18n ( $ this -> getBackendContext ( ) , $ this -> getLang ... | Setup ModelCriteria for proper i18n processing |
15,546 | public function isMultidimensional ( ) { foreach ( $ this -> elements -> getItems ( ) as $ element ) { if ( $ element instanceof ArrayPairNode ) { if ( $ element -> getValue ( ) instanceof ArrayNode ) { return TRUE ; } } elseif ( $ element instanceof ArrayNode ) { return TRUE ; } } return FALSE ; } | Tests if the array contains another array . |
15,547 | public function toValue ( ) { $ ret = array ( ) ; foreach ( $ this -> elements -> getItems ( ) as $ element ) { if ( $ element instanceof ArrayNode ) { $ ref [ ] = $ element -> toValue ( ) ; } elseif ( $ element instanceof ArrayPairNode ) { $ key = $ element -> getKey ( ) ; $ value = $ element -> getValue ( ) ; $ value... | Convert to PHP array . |
15,548 | public function hasKey ( $ key , $ recursive = TRUE ) { if ( ! ( $ key instanceof ExpressionNode ) && ! is_scalar ( $ key ) ) { throw new \ InvalidArgumentException ( ) ; } $ keys = $ this -> getKeys ( $ recursive ) ; if ( is_scalar ( $ key ) ) { return $ keys -> filter ( Filter :: isInstanceOf ( '\Pharborist\Types\Sca... | Returns if the array has a specific key . |
15,549 | public function getKeys ( $ recursive = TRUE ) { $ keys = new NodeCollection ( ) ; $ index = 0 ; foreach ( $ this -> elements -> getItems ( ) as $ element ) { if ( $ element instanceof ArrayPairNode ) { $ keys -> add ( $ element -> getKey ( ) ) ; $ value = $ element -> getValue ( ) ; } else { $ keys -> add ( Token :: i... | Get the keys of the array . |
15,550 | public function getValues ( $ recursive = TRUE ) { $ values = new NodeCollection ( ) ; foreach ( $ this -> elements -> getItems ( ) as $ element ) { if ( $ element instanceof ArrayPairNode ) { $ value = $ element -> getValue ( ) ; if ( $ recursive && $ value instanceof ArrayNode ) { $ values -> add ( $ value -> getValu... | Get the values of the array . |
15,551 | public function configureAction ( $ id ) { $ exportHandler = $ this -> container -> get ( 'thelia.export.handler' ) ; $ export = $ exportHandler -> getExport ( $ id ) ; if ( $ export === null ) { return $ this -> pageNotFound ( ) ; } $ templateName = 'export-page' ; if ( $ this -> getRequest ( ) -> isXmlHttpRequest ( )... | Display export configuration view |
15,552 | public function exportAction ( $ id ) { $ exportHandler = $ this -> container -> get ( 'thelia.export.handler' ) ; $ export = $ exportHandler -> getExport ( $ id ) ; if ( $ export === null ) { return $ this -> pageNotFound ( ) ; } $ form = $ this -> createForm ( AdminForm :: EXPORT ) ; try { $ validatedForm = $ this ->... | Handle export action |
15,553 | public function current ( ) { if ( $ this -> position >= $ this -> length ) { return NULL ; } return $ this -> tokens [ $ this -> position ] ; } | Return the current token . |
15,554 | public function peek ( $ offset ) { if ( $ this -> position + $ offset >= $ this -> length ) { return NULL ; } return $ this -> tokens [ $ this -> position + $ offset ] ; } | Peek ahead . |
15,555 | public function next ( ) { $ this -> position ++ ; if ( $ this -> position >= $ this -> length ) { $ this -> position = $ this -> length ; return NULL ; } return $ this -> tokens [ $ this -> position ] ; } | Move to the next token and return it . |
15,556 | public function make ( array $ config ) { Arr :: requires ( $ config , [ 'token' ] ) ; $ client = new Client ( ) ; return new YoGateway ( $ client , $ config ) ; } | Create a new yo gateway instance . |
15,557 | public function isNotPaid ( $ exact = true ) { if ( $ exact ) { return $ this -> hasStatusHelper ( OrderStatus :: CODE_NOT_PAID ) ; } else { return ! $ this -> isPaid ( false ) ; } } | Check if the current status is NOT PAID |
15,558 | public function isPaid ( $ exact = true ) { return $ this -> hasStatusHelper ( $ exact ? OrderStatus :: CODE_PAID : [ OrderStatus :: CODE_PAID , OrderStatus :: CODE_PROCESSING , OrderStatus :: CODE_SENT ] ) ; } | Check if the current status is PAID |
15,559 | private function checkAvailability ( ) { $ available = get_site_transient ( 'boldgrid_available' ) ; $ wp_http = new WP_Http ( ) ; $ url = $ this -> getUrl ( ) ; if ( $ wp_http -> block_request ( $ url ) === false ) { $ available = 1 ; } set_site_transient ( 'boldgrid_available' , ( int ) $ available , 2 * MINUTE_IN_SE... | Checks that the API can be reached . |
15,560 | public function getTreePagesByPageIdAction ( ) { $ idPage = $ this -> params ( ) -> fromQuery ( 'nodeId' , - 1 ) ; $ this -> getEventManager ( ) -> trigger ( 'melis_cms_tree_get_pages_start' , $ this , array ( 'idPage' => $ idPage ) ) ; if ( $ idPage == - 1 ) $ rootPages = $ this -> getRootForUser ( ) ; else $ rootPage... | Get the children of an idPage If called in http will return an html view If called in xhr will return a json view with the html and others informations like javascript datas . |
15,561 | public function getTreePagesForRightsManagementAction ( ) { $ idPage = $ this -> params ( ) -> fromQuery ( 'nodeId' , - 1 ) ; if ( $ idPage == MelisCmsRightsService :: MELISCMS_PREFIX_PAGES . '_root' ) $ idPage = - 1 ; else $ idPage = str_replace ( MelisCmsRightsService :: MELISCMS_PREFIX_PAGES . '_' , '' , $ idPage ) ... | Gets the root page when showing the tree of pages in rights tool so that all pages are displayed and not only the one you have access to |
15,562 | private function cleanBreadcrumb ( $ breadcrumb ) { $ newArray = array ( ) ; if ( ! empty ( $ breadcrumb ) ) foreach ( $ breadcrumb as $ page ) { if ( ! empty ( $ page -> tree_page_id ) ) array_push ( $ newArray , $ page -> tree_page_id ) ; } return $ newArray ; } | Creates a simple array with the page ids from the result of db |
15,563 | private function getRootForUser ( ) { $ melisEngineTree = $ this -> serviceLocator -> get ( 'MelisEngineTree' ) ; $ melisCoreAuth = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreAuth' ) ; $ melisCmsRights = $ this -> getServiceLocator ( ) -> get ( 'MelisCmsRights' ) ; $ xmlRights = $ melisCoreAuth -> getAuthRights... | Gets the root pages for a user depending on his rights |
15,564 | public function getPageIdBreadcrumbAction ( ) { $ idPage = $ this -> params ( ) -> fromRoute ( 'idPage' , $ this -> params ( ) -> fromQuery ( 'idPage' , '' ) ) ; $ idPage = ( $ idPage == 'root' ) ? - 1 : $ idPage ; $ includeSelf = $ this -> params ( ) -> fromRoute ( 'includeSelf' , $ this -> params ( ) -> fromQuery ( '... | Sends back the pageId breadcrumb |
15,565 | public function canEditPagesAction ( ) { $ melisCoreAuth = $ this -> getServiceLocator ( ) -> get ( 'MelisCoreAuth' ) ; $ xmlRights = $ melisCoreAuth -> getAuthRights ( ) ; $ rightsObj = simplexml_load_string ( $ xmlRights ) ; $ sectionId = MelisCmsRightsService :: MELISCMS_PREFIX_PAGES ; if ( empty ( $ rightsObj -> $ ... | Sends back if a page can be edited by the user or not |
15,566 | public function getDiscount ( ) { $ discount = 0.00 ; $ coupons = $ this -> facade -> getCurrentCoupons ( ) ; if ( \ count ( $ coupons ) > 0 ) { $ couponsKept = $ this -> sortCoupons ( $ coupons ) ; $ discount = $ this -> getEffect ( $ couponsKept ) ; $ checkoutTotalPrice = $ this -> facade -> getCartTotalTaxPrice ( ) ... | Get Discount for the given Coupons |
15,567 | public function isCouponRemovingPostage ( Order $ order ) { $ coupons = $ this -> facade -> getCurrentCoupons ( ) ; if ( \ count ( $ coupons ) == 0 ) { return false ; } $ couponsKept = $ this -> sortCoupons ( $ coupons ) ; foreach ( $ couponsKept as $ coupon ) { if ( $ coupon -> isRemovingPostage ( ) ) { $ couponCountr... | Check if there is a Coupon removing Postage |
15,568 | protected function sortCoupons ( array $ coupons ) { $ couponsKept = array ( ) ; foreach ( $ coupons as $ coupon ) { if ( $ coupon && ! $ coupon -> isExpired ( ) ) { if ( $ coupon -> isCumulative ( ) ) { if ( isset ( $ couponsKept [ 0 ] ) ) { $ previousCoupon = $ couponsKept [ 0 ] ; if ( $ previousCoupon -> isCumulativ... | Sort Coupon to keep Coupon not cumulative cancels previous |
15,569 | protected function getEffect ( array $ coupons ) { $ discount = 0.00 ; foreach ( $ coupons as $ coupon ) { $ discount += $ coupon -> exec ( $ this -> facade ) ; } return $ discount ; } | Process given Coupon in order to get their cumulative effects |
15,570 | public function clear ( ) { $ coupons = $ this -> facade -> getCurrentCoupons ( ) ; foreach ( $ coupons as $ coupon ) { $ coupon -> clear ( ) ; } } | Clear all data kept by coupons |
15,571 | public function decrementQuantity ( Coupon $ coupon , $ customerId = null ) { if ( $ coupon -> isUsageUnlimited ( ) ) { return true ; } else { try { $ usageLeft = $ coupon -> getUsagesLeft ( $ customerId ) ; if ( $ usageLeft > 0 ) { if ( $ coupon -> getPerCustomerUsageCount ( ) ) { if ( null == $ customerId ) { throw n... | Decrement this coupon quantity |
15,572 | public function format ( AddressInterface $ address , $ locale = null , $ html = true , $ htmlTag = "p" , $ htmlAttributes = [ ] ) { $ locale = $ this -> normalizeLocale ( $ locale ) ; $ addressFormatRepository = new AddressFormatRepository ( ) ; $ countryRepository = new CountryRepository ( ) ; $ subdivisionRepository... | Format an address |
15,573 | public function postalLabelFormat ( AddressInterface $ address , $ locale = null , $ originCountry = null , $ options = [ ] ) { $ locale = $ this -> normalizeLocale ( $ locale ) ; $ addressFormatRepository = new AddressFormatRepository ( ) ; $ countryRepository = new CountryRepository ( ) ; $ subdivisionRepository = ne... | Format an address to a postal label |
15,574 | public function getTranslator ( ) { if ( null === $ this -> translator ) { $ this -> translator = $ this -> container -> get ( 'thelia.translator' ) ; } return $ this -> translator ; } | return the Translator |
15,575 | protected function retrieveFormBasedUrl ( $ parameterName , BaseForm $ form = null ) { $ url = null ; if ( $ form != null ) { $ url = $ form -> getFormDefinedUrl ( $ parameterName ) ; } else { $ url = $ this -> container -> get ( 'request_stack' ) -> getCurrentRequest ( ) -> get ( $ parameterName ) ; } return $ url ; } | Search url in a form parameter or in a request parameter . |
15,576 | protected function getRoute ( $ routeId , $ parameters = array ( ) , $ referenceType = Router :: ABSOLUTE_URL ) { return $ this -> getRouteFromRouter ( $ this -> getCurrentRouter ( ) , $ routeId , $ parameters , $ referenceType ) ; } | Return the route path defined for the givent route ID |
15,577 | protected function getRouteFromRouter ( $ routerName , $ routeId , $ parameters = array ( ) , $ referenceType = Router :: ABSOLUTE_URL ) { $ router = $ this -> getRouter ( $ routerName ) ; if ( $ router == null ) { throw new \ InvalidArgumentException ( sprintf ( "Router '%s' does not exists." , $ routerName ) ) ; } re... | Get a route path from the route id . |
15,578 | protected function checkXmlHttpRequest ( ) { if ( false === $ this -> container -> get ( 'request_stack' ) -> getCurrentRequest ( ) -> isXmlHttpRequest ( ) && false === $ this -> isDebug ( ) ) { $ this -> accessDenied ( ) ; } } | check if the current http request is a XmlHttpRequest . |
15,579 | protected function performAdditionalDeleteAction ( $ deleteEvent ) { if ( $ deleteEvent -> getProductCount ( ) > 0 ) { $ this -> getParserContext ( ) -> setGeneralError ( $ this -> getTranslator ( ) -> trans ( "This template is in use in some of your products, and cannot be deleted. Delete it from all your products and... | Process delete failure which may occurs if template is in use . |
15,580 | public static function append ( $ resource , $ action , $ message , Request $ request , UserInterface $ adminUser = null , $ withRequestContent = true , $ resourceId = null ) { $ log = new AdminLog ( ) ; $ log -> setAdminLogin ( $ adminUser !== null ? $ adminUser -> getUsername ( ) : '<no login>' ) -> setAdminFirstname... | A simple helper to insert an entry in the admin log |
15,581 | protected function spaceBefore ( Node $ node ) { $ prev = $ node -> previousToken ( ) ; if ( $ prev instanceof WhitespaceNode ) { $ prev -> setText ( ' ' ) ; } else { $ node -> before ( Token :: space ( ) ) ; } } | Set a single space before a node . |
15,582 | protected function spaceAfter ( Node $ node ) { $ next = $ node -> nextToken ( ) ; if ( $ next instanceof WhitespaceNode ) { $ next -> setText ( ' ' ) ; } else { $ node -> after ( Token :: space ( ) ) ; } } | Set a single space after a node . |
15,583 | protected function removeSpaceBefore ( Node $ node ) { $ prev = $ node -> previousToken ( ) ; if ( $ prev instanceof WhitespaceNode ) { $ prev -> remove ( ) ; } } | Remove whitespace before a node . |
15,584 | protected function removeSpaceAfter ( Node $ node ) { $ next = $ node -> nextToken ( ) ; if ( $ next instanceof WhitespaceNode ) { $ next -> remove ( ) ; } } | Remove whitespace after a node . |
15,585 | protected function newlineBefore ( Node $ node , $ close = FALSE ) { $ prev = $ node -> previousToken ( ) ; if ( $ prev instanceof WhitespaceNode ) { $ prev_ws = $ prev -> previousToken ( ) ; if ( $ prev_ws instanceof CommentNode && $ prev_ws -> isLineComment ( ) && $ prev -> getNewlineCount ( ) === 0 ) { $ prev -> set... | Set so there a newline before a node . |
15,586 | protected function newlineAfter ( Node $ node ) { $ next = $ node -> nextToken ( ) ; if ( $ next instanceof WhitespaceNode ) { $ next -> setText ( $ this -> getNewlineIndent ( $ next ) ) ; } else { $ node -> after ( Token :: whitespace ( $ this -> getNewlineIndent ( ) ) ) ; } } | Set so there a newline after a node . |
15,587 | protected function handleBuiltinConstantNode ( ConstantNode $ node ) { $ to_upper = $ this -> config [ 'boolean_null_upper' ] ; if ( $ to_upper ) { $ node -> toUpperCase ( ) ; } else { $ node -> toLowerCase ( ) ; } } | Handle formatting of constant node . |
15,588 | protected function encloseBlock ( $ node ) { if ( $ node && ! ( $ node instanceof StatementBlockNode ) ) { $ blockNode = new StatementBlockNode ( ) ; $ blockNode -> append ( [ Token :: openBrace ( ) , clone $ node , Token :: closeBrace ( ) ] ) ; $ node -> replaceWith ( $ blockNode ) ; } } | Wrap single line body statements in braces . |
15,589 | protected function handleParens ( $ node ) { $ open_paren = $ node -> getOpenParen ( ) ; $ this -> removeSpaceAfter ( $ open_paren ) ; $ this -> spaceBefore ( $ open_paren ) ; $ close_paren = $ node -> getCloseParen ( ) ; $ this -> removeSpaceBefore ( $ close_paren ) ; } | Handle whitespace around and inside parens for control structures . |
15,590 | protected function handleControlStructure ( $ node ) { $ this -> handleParens ( $ node ) ; $ colons = $ node -> children ( Filter :: isTokenType ( ':' ) ) ; foreach ( $ colons as $ colon ) { $ this -> removeSpaceBefore ( $ colon ) ; } if ( $ colons -> isNotEmpty ( ) ) { $ this -> newlineBefore ( $ node -> lastChild ( )... | Generic formatting rules for control structures . |
15,591 | protected function isDeclaration ( ParentNode $ node ) { return $ node instanceof FunctionDeclarationNode || $ node instanceof SingleInheritanceNode || $ node instanceof InterfaceNode || $ node instanceof ClassMethodNode || $ node instanceof InterfaceMethodNode ; } | Test if declaration_brace_newline setting applies to node . |
15,592 | protected function calculateColumnPosition ( Node $ node ) { $ column_position = 1 ; $ start_token = $ node instanceof ParentNode ? $ node -> firstToken ( ) : $ node ; $ token = $ start_token ; while ( $ token = $ token -> previousToken ( ) ) { if ( $ token instanceof WhitespaceNode && $ token -> getNewlineCount ( ) > ... | Calculate the column start position of the node . |
15,593 | public function setEffects ( array $ effects ) { $ this -> amount = isset ( $ effects [ 'amount' ] ) ? $ effects [ 'amount' ] : 0 ; $ this -> effects = $ effects ; } | Set effects ready to be serialized |
15,594 | public function toMessage ( ) { return array_merge ( $ this -> attributes , [ 'topic' => $ this -> topic , 'event' => $ this -> name , 'version' => $ this -> version , ] ) ; } | Return the event in a message format ready for publishing . |
15,595 | public function matches ( $ expr ) { $ params = self :: parseEventExpr ( $ expr ) ; if ( $ params [ 'topic' ] === '*' ) { return true ; } elseif ( $ this -> topic !== $ params [ 'topic' ] ) { return false ; } if ( $ params [ 'event' ] === '*' ) { return true ; } elseif ( $ this -> name !== $ params [ 'event' ] ) { retu... | Check whether or not the event matches the given expression . |
15,596 | public static function createOperator ( $ token_type , $ static_only = FALSE ) { if ( array_key_exists ( $ token_type , self :: $ operators ) ) { list ( $ assoc , $ precedence , $ static , $ binary_class_name , $ unary_class_name ) = self :: $ operators [ $ token_type ] ; if ( $ static_only && ! $ static ) { return NUL... | Create an OperatorNode for the given token type . |
15,597 | public static function getPluginFile ( $ slug ) { if ( ! function_exists ( 'get_plugins' ) ) { require ABSPATH . '/wp-admin/includes/plugin.php' ; } $ plugins = get_plugins ( ) ; foreach ( $ plugins as $ file => $ info ) { $ basename = dirname ( plugin_basename ( $ file ) ) ; if ( $ basename === $ slug ) { return $ fil... | Helper to get and verify the plugin file . |
15,598 | public function buildCouponFromCode ( $ couponCode ) { $ couponModel = $ this -> facade -> findOneCouponByCode ( $ couponCode ) ; if ( $ couponModel === null ) { return false ; } if ( ! $ couponModel -> getIsEnabled ( ) ) { throw new InactiveCouponException ( $ couponCode ) ; } $ nowDateTime = new \ DateTime ( ) ; if (... | Build a CouponInterface from its database data |
15,599 | public function buildCouponFromModel ( Coupon $ model ) { $ isCumulative = ( $ model -> getIsCumulative ( ) == 1 ? true : false ) ; $ isRemovingPostage = ( $ model -> getIsRemovingPostage ( ) == 1 ? true : false ) ; if ( ! $ this -> container -> has ( $ model -> getType ( ) ) ) { return false ; } $ couponManager = $ th... | Build a CouponInterface from its Model data contained in the DataBase |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.