idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
55,300 | protected function getIsExpired ( Document $ document ) { $ date = null === $ document -> getDateEdit ( ) ? $ document -> getDateInsert ( ) : $ document -> getDateEdit ( ) ; $ now = new \ Datetime ( "now" ) ; $ interval = $ date -> diff ( $ now ) ; if ( $ interval -> y > 0 ) { return true ; } return $ interval -> m >= ... | If the classified is > = 6 months old is expired |
55,301 | protected function getUserHashId ( Document $ document , $ sm ) { $ user = $ document -> getUser ( ) ; $ main = $ sm -> get ( 'neobazaar.service.main' ) ; $ userRepository = $ main -> getUserEntityRepository ( ) ; return $ userRepository -> getEncryptedId ( $ user -> getUserId ( ) ) ; } | Return the user hash id for the classified . It s an sha1 hash . Also fill userIdNoHash |
55,302 | protected function getEditAddress ( Document $ document ) { $ key = null === $ this -> hashId ? $ this -> getHashId ( $ document ) : $ this -> hashId ; return '/edit-classified/' . $ key . '.html' ; } | Get the address to be called to edit classified |
55,303 | protected function getHashId ( Document $ document , $ sm ) { $ main = $ sm -> get ( 'neobazaar.service.main' ) ; $ documentRepository = $ main -> getDocumentEntityRepository ( ) ; return $ documentRepository -> getEncryptedId ( $ document -> getDocumentId ( ) ) ; } | Return the classified hash id . It s an sha1 hash |
55,304 | protected function getAddress ( Document $ document , $ sm ) { $ firstCategory = null === $ this -> category ? $ this -> getCategory ( $ document ) : $ this -> category ; $ key = null === $ this -> hashId ? $ this -> getHashId ( $ document , $ sm ) : $ this -> hashId ; $ slug = null === $ this -> slug ? $ this -> getSl... | Get the classified full adress |
55,305 | protected function getCategory ( Document $ document ) { $ obj = new CategoriesToRender ( ) ; $ categories = $ obj ( $ document , true , true ) ; $ firstCategory = reset ( $ categories ) ; return $ firstCategory ; } | The first category as slug |
55,306 | protected function getLocation ( Document $ document , $ sm ) { $ main = $ sm -> get ( 'neobazaar.service.main' ) ; $ location = $ document -> getGeoname ( ) ; if ( null !== $ location ) { if ( 'ADM3' == $ location -> getFeatureCode ( ) ) { $ location = $ main -> getGeonamesEntityRepository ( ) -> getParent ( $ locatio... | Get the classified location . To make the ADM2 select populated it will use the parent entity if the location is an ADM3 |
55,307 | protected function getPurpose ( Document $ document ) { $ value = '' ; foreach ( $ document -> getMetadata ( ) as $ meta ) { if ( 'finalita' == $ meta -> getKey ( ) ) { $ value = $ meta -> getValue ( ) ; break ; } } return $ value ; } | Get the classified purpose |
55,308 | protected function getHideMobile ( Document $ document ) { foreach ( $ document -> getMetadata ( ) as $ meta ) { if ( 'hidemobile' == $ meta -> getKey ( ) ) { $ v = $ meta -> getValue ( ) ; return $ v ; break ; } } return false ; } | Get the classified hidemobile meta value |
55,309 | public function add ( array $ data , $ preserveArray = false , $ preserveKeyOnly = null ) { foreach ( $ data as $ key => $ value ) { if ( is_array ( $ value ) && ( ! $ preserveArray || ( $ preserveArray && $ preserveKeyOnly && $ key !== $ preserveKeyOnly ) ) ) { $ this -> $ key = ( array_key_exists ( 0 , $ value ) ) ? ... | Adds data to the object |
55,310 | public function toArray ( $ recursive = false ) { $ return = get_object_vars ( $ this ) ; if ( $ recursive ) { foreach ( $ return as $ ppt => & $ val ) { if ( $ ppt === 'integerkeys' ) continue ; if ( is_object ( $ val ) && method_exists ( $ val , 'toArray' ) ) { $ val = $ val -> toArray ( true ) ; } } } unset ( $ retu... | Returns array of properties |
55,311 | public function getBodyWeight ( GenderCode $ genderCode , Tables $ tables ) : int { $ weightInKg = $ this -> getWeightInKg ( $ genderCode , $ tables ) ; return ( new Weight ( $ weightInKg , Weight :: KG , $ tables -> getWeightTable ( ) ) ) -> getBonus ( ) -> getValue ( ) ; } | Bonus of body weight |
55,312 | public static function any ( string $ path , $ handler ) : array { return [ static :: get ( $ path , $ handler ) , static :: post ( $ path , $ handler ) , static :: put ( $ path , $ handler ) , static :: patch ( $ path , $ handler ) , static :: delete ( $ path , $ handler ) , ] ; } | Add a route that matches any HTTP verb |
55,313 | public static function match ( array $ verbs , string $ path , $ handler ) : array { $ routes = [ ] ; foreach ( $ verbs as $ verb ) { switch ( strtolower ( $ verb ) ) { case 'get' : $ routes [ ] = static :: get ( $ path , $ handler ) ; break ; case 'post' : $ routes [ ] = static :: post ( $ path , $ handler ) ; break ;... | Add a route that matches the given HTTP verbs |
55,314 | protected static function add ( string $ verb , string $ path , $ handler ) : Route { $ router = static :: getRouterInstance ( ) ; $ route = new static ( $ router , $ verb , $ path , $ handler ) ; Router :: addRoute ( $ verb , $ route ) ; return $ route ; } | Creates a new route |
55,315 | public function createRegex ( ) { $ parts = explode ( '/' , ltrim ( $ this -> path , '/' ) ) ; $ regex = '/^' ; foreach ( $ parts as $ part ) { $ regex .= '\/' ; if ( stripos ( $ part , '{' ) === false && stripos ( $ part , '}' ) === false ) { $ regex .= $ part ; continue ; } $ name = str_ireplace ( [ '{' , '}' ] , '' ... | Creates a regular expression to match the route |
55,316 | private function runMultiLanguage ( ) : void { if ( ! App :: $ Properties -> get ( 'multiLanguage' ) ) { $ this -> language = App :: $ Properties -> get ( 'singleLanguage' ) ; return ; } if ( Any :: isArray ( App :: $ Properties -> get ( 'languageDomainAlias' ) ) ) { $ domainAlias = App :: $ Properties -> get ( 'langua... | Build multi language pathway binding . |
55,317 | private function setLanguageFromBrowser ( ) : void { $ userLang = App :: $ Properties -> get ( 'singleLanguage' ) ; $ browserAccept = $ this -> getLanguages ( ) ; if ( Any :: isArray ( $ browserAccept ) && count ( $ browserAccept ) > 0 ) { foreach ( $ browserAccept as $ bLang ) { if ( Arr :: in ( $ bLang , App :: $ Pro... | Set language from browser headers |
55,318 | private function composeSnapItem ( $ customerId , $ parentId , $ dsChanged , $ snap ) { $ result = new ESnap ( ) ; $ result -> setCustomerRef ( $ customerId ) ; $ result -> setParentRef ( $ parentId ) ; $ result -> setDate ( $ dsChanged ) ; if ( $ customerId == $ parentId ) { $ newDepth = Cfg :: INIT_DEPTH ; $ newPath ... | Compose snapshot item . |
55,319 | final protected function getArrayValue ( string $ key ) : array { $ value = $ this -> getConfigValue ( $ key ) ; if ( ! $ value || ! \ is_array ( $ value ) ) { return [ ] ; } return $ value ; } | Returns an array value . |
55,320 | final protected function getStringValue ( string $ key , string $ default = '' ) : string { $ value = $ this -> getConfigValue ( $ key ) ; if ( ! $ value ) { return $ default ; } return strval ( $ value ) ; } | Retrieves a string configuration parameter . |
55,321 | final protected function getBooleanValue ( string $ key , bool $ default = false ) : bool { $ value = $ this -> getConfigValue ( $ key ) ; if ( ! $ value ) { return $ default ; } return \ boolval ( $ value ) ; } | Retrieves a boolean configuration parameter . |
55,322 | private function isBaseConfigPropertiesSet ( ) : bool { return isset ( $ this -> config [ ConfigurationInterface :: KEY_APP_ROOT ] , $ this -> config [ ConfigurationInterface :: KEY_CONFIG_ROOT ] , $ this -> config [ ConfigurationInterface :: KEY_CACHE_ROOT ] , $ this -> config [ ConfigurationInterface :: KEY_THEMES_RO... | Checks that all the mandatory properties are set . |
55,323 | public function _pre_wp_nav_menu ( $ output , $ args ) { if ( is_customize_preview ( ) ) { return $ output ; } if ( ! $ args -> theme_location ) { return $ output ; } if ( ! $ this -> _is_caching_nav_menus ( ) ) { return $ output ; } if ( ! $ this -> _is_caching_nav_menu ( $ args -> theme_location ) ) { return $ output... | Output nav menu |
55,324 | public function _remove_current_classes ( $ items , $ args ) { if ( is_customize_preview ( ) ) { return $ items ; } if ( ! static :: _is_caching_nav_menus ( ) ) { return $ items ; } if ( ! $ this -> _is_caching_nav_menu ( $ args -> theme_location ) ) { return $ items ; } foreach ( $ items as $ items_index => $ item ) {... | Remove current classes |
55,325 | public static function enable ( $ reportingLevel = NULL , $ displayErrors = NULL ) { if ( ! static :: $ enabled ) { static :: $ enabled = true ; error_reporting ( E_ALL ) ; ErrorHandler :: register ( $ reportingLevel , $ displayErrors ) ; if ( PHP_SAPI !== 'cli' ) { ExceptionHandler :: register ( $ reportingLevel , $ d... | activate custom debugging registers error handler and exception handler |
55,326 | public function sql ( $ sql , array $ values = array ( ) ) { $ this -> whereSqlConditions [ ] = $ sql ; $ this -> arguments = array_merge ( $ this -> arguments , $ values ) ; return $ this ; } | Adds sql statement into where statement |
55,327 | public function like ( $ field , $ value ) { $ operator = ' ' . $ this -> executable -> provideSqlDialect ( ) -> likeOperator ( ) . ' ' ; return $ this -> setTwoArgsOperator ( $ field , $ value , $ operator ) ; } | Adds LIKE statement into where statement |
55,328 | protected function SaveElement ( ) { $ this -> register -> SetConfirmUrl ( $ this -> selectorConfirm -> Save ( $ this -> register -> GetConfirmUrl ( ) ) ) ; $ this -> register -> SetNextUrl ( $ this -> selectorNext -> Save ( $ this -> register -> GetNextUrl ( ) ) ) ; $ this -> register -> SetMailFrom ( $ this -> Value ... | Saves the simple register element |
55,329 | function prepareHtml ( ) { $ this -> html = trim ( preg_replace ( '/\t\n/' , '' , $ this -> html ) ) ; $ this -> html = preg_replace ( '/\s+/' , ' ' , $ this -> html ) ; $ this -> html = $ this -> replaceSpecialCharacters ( $ this -> html ) ; } | Prepares HTML for processing |
55,330 | function parseDocument ( ) { $ this -> prepareHtml ( ) ; $ current = libxml_use_internal_errors ( true ) ; $ disableEntities = libxml_disable_entity_loader ( true ) ; $ charset = 'UTF-8' ; $ this -> doc = new \ DOMDocument ( '1.0' , $ charset ) ; $ this -> doc -> strictErrorChecking = false ; @ $ this -> doc -> loadHTM... | Parses the HTML document |
55,331 | private function generateTmlTags ( $ node ) { $ buffer = "" ; foreach ( $ node -> childNodes as $ child ) { if ( $ child -> nodeType == 3 ) { $ buffer = $ buffer . $ child -> wholeText ; } else { $ buffer = $ buffer . $ this -> generateTmlTags ( $ child ) ; } } $ token_context = $ this -> generateHtmlToken ( $ node ) ;... | TML nodes can be nested - but they CANNOT contain non - inline nodes |
55,332 | private function resetContext ( ) { $ this -> debug_tokens = $ this -> tokens ; $ this -> tokens = array_merge ( array ( ) , $ this -> context ) ; } | Resets context of the current translation |
55,333 | function send ( ) { if ( ! headers_sent ( ) ) { extract ( $ this -> toArray ( ) ) ; setcookie ( $ name , $ value , $ expires , $ path , $ domain , $ secure , $ httponly ) ; } } | Sets the cookie to be sent by the headers |
55,334 | public function addError ( Error $ error ) { $ this -> result -> addError ( $ error ) ; $ this -> setObjectType ( self :: OBJECT_TYPE_NONE ) ; } | Adds an error to the processor which may then be merged with the errors of the property being currently mapped . |
55,335 | public static function key ( $ key , $ value = null ) { if ( $ value == null ) return $ _SESSION [ $ key ] ; $ _SESSION [ $ key ] = $ value ; } | Set or get session key |
55,336 | public static function flash ( string $ key , $ value = null ) { return $ _SESSION [ 'application' ] [ 'with' ] = array_merge ( isset ( $ _SESSION [ 'application' ] [ 'with' ] ) ? $ _SESSION [ 'application' ] [ 'with' ] : [ ] , [ $ key => $ value ] ) ; } | Create a flash message |
55,337 | public function register ( array $ definitions ) : self { foreach ( $ definitions as $ name => $ callback ) { if ( ! is_callable ( $ callback ) ) { throw new \ InvalidArgumentException ( 'Values passed to register must be callable' ) ; } $ this -> definitions [ $ name ] = $ callback ; } return $ this ; } | Registers rule definitions . |
55,338 | public function alias ( string $ name , $ rules , ? string $ error = null ) : self { $ this -> definitions [ $ name ] = function ( ) use ( $ rules , $ error ) { return $ this -> parser -> parse ( $ rules ) -> setError ( $ error ) ; } ; return $ this ; } | Registers an alias for a ruleset . |
55,339 | public function aliasDefinition ( $ definition ) : self { if ( is_object ( $ definition ) ) { $ definition = ( array ) $ definition ; } if ( ! is_array ( $ definition ) ) { throw new \ InvalidArgumentException ( "Invalid alias definition: must be an object or an associative array" ) ; } if ( ! isset ( $ definition [ 'n... | Registers an alias for a ruleset using a LIVR - compliant definition . |
55,340 | public function factory ( string $ name , $ arg = null ) : Rule { if ( ! array_key_exists ( $ name , $ this -> definitions ) ) { throw new \ InvalidArgumentException ( "No rule registered with name: $name" ) ; } $ vrule = is_array ( $ arg ) ? call_user_func_array ( $ this -> definitions [ $ name ] , $ arg ) : call_user... | Constructs a validation rule . |
55,341 | public static function populateEnvironment ( Event $ event ) { $ url = getenv ( 'CLEARDB_DATABASE_URL' ) ; if ( $ url ) { $ url = parse_url ( $ url ) ; putenv ( "SYMFONY_DATABASE_HOST={$url['host']}" ) ; putenv ( "SYMFONY_DATABASE_USER={$url['user']}" ) ; putenv ( "SYMFONY_DATABASE_PASSWORD={$url['pass']}" ) ; $ db = s... | Populate Heroku environment |
55,342 | public function putQuoteId ( $ data ) { if ( $ this -> registry -> registry ( self :: QUOTE_ID ) ) { $ this -> registry -> unregister ( self :: QUOTE_ID ) ; } $ this -> registry -> register ( self :: QUOTE_ID , $ data ) ; } | Quote ID for newly created orders . |
55,343 | protected function findTags ( ContainerBuilder $ container , $ tagName , $ argumentPosition , $ ext = false ) : void { $ services = [ ] ; foreach ( $ container -> findTaggedServiceIds ( $ tagName ) as $ serviceId => $ tag ) { $ class = isset ( $ tag [ 0 ] [ 'class' ] ) ? $ this -> getRealClassName ( $ container , $ tag... | Find service tags . |
55,344 | protected function getRealClassName ( ContainerBuilder $ container , $ classname ) { return 0 === strpos ( $ classname , '%' ) ? $ container -> getParameter ( trim ( $ classname , '%' ) ) : $ classname ; } | Get the real class name . |
55,345 | protected function getClassName ( ContainerBuilder $ container , $ serviceId , $ tagName ) { $ type = $ container -> getDefinition ( $ serviceId ) ; $ interfaces = class_implements ( $ type -> getClass ( ) ) ; if ( \ in_array ( ObjectTypeExtensionInterface :: class , $ interfaces , true ) ) { throw new InvalidConfigura... | Get the class name of default value type . |
55,346 | protected function buildInstanceType ( Definition $ type , $ serviceId , $ tagName ) { $ parents = class_parents ( $ type -> getClass ( ) ) ; $ args = $ type -> getArguments ( ) ; $ ref = new \ ReflectionClass ( $ type ) ; if ( \ in_array ( AbstractSimpleType :: class , $ parents , true ) && ( 0 === \ count ( $ args ) ... | Build the simple default type instance . |
55,347 | private function findResolveTarget ( ContainerBuilder $ container , $ class ) { $ resolveTargets = $ this -> getResolveTargets ( $ container ) ; if ( isset ( $ resolveTargets [ $ class ] ) ) { $ class = $ resolveTargets [ $ class ] ; } return $ class ; } | Find the resolve target of class . |
55,348 | private function replaceResolveTargetClass ( ContainerBuilder $ container , $ tagName , $ serviceId , $ class ) : void { $ def = $ container -> getDefinition ( $ serviceId ) ; $ this -> replaceClassInArguments ( $ container , $ def , $ class ) ; $ this -> replaceClassInTags ( $ def , $ tagName , $ class ) ; } | Replace the resolve target class . |
55,349 | protected function deleteLocaleData ( $ localeCode , OutputInterface $ output ) { $ entityManager = $ this -> getDoctrineHelper ( ) -> getEntityManager ( ) ; $ metadata = $ this -> getDoctrineHelper ( ) -> getAllMetadata ( ) ; $ locale = $ this -> getLocaleRepository ( ) -> findOneBy ( [ 'code' => $ localeCode ] ) ; if... | Deletes the locale |
55,350 | public function setSeedFarm ( \ Librinfo \ SeedBatchBundle \ Entity \ SeedFarm $ seedFarm = null ) { $ this -> seedFarm = $ seedFarm ; return $ this ; } | Set seedFarm . |
55,351 | private function createErrorHandler ( ) { return function ( $ errno , $ errstr , $ errfile , $ errline ) { if ( ! ( error_reporting ( ) & $ errno ) ) { return ; } throw new \ ErrorException ( $ errstr , 0 , $ errno , $ errfile , $ errline ) ; } ; } | Creates and returns a callable error handler that raises exceptions . |
55,352 | public function build ( $ aConnection , array $ mappingsPaths = [ ] , $ isDevMode = true ) { if ( empty ( $ mappingsPaths ) ) { $ mappingsPaths = [ __DIR__ . '/Mapping' ] ; } Type :: addType ( 'user_id' , UserIdType :: class ) ; Type :: addType ( 'user_roles' , UserRolesType :: class ) ; return EntityManager :: create ... | Creates an entity manager instance enabling mappings and custom types . |
55,353 | public function get ( string $ type , string $ id ) { if ( $ this -> shouldCacheEntity ( $ type , $ id ) ) { $ key = $ this -> getKey ( $ type , $ id ) ; $ this -> logger -> debug ( 'Fetching from cache' , [ 'type' => $ type , 'id' => $ id , 'key' => $ key , ] ) ; if ( $ item = $ this -> cache -> fetch ( $ key ) ) { re... | Get single entity . |
55,354 | private function getFreshDataWithCache ( QueueItem $ item ) { $ sdk = $ this -> getSdk ( $ item ) ; $ entity = $ sdk -> get ( $ item -> getId ( ) ) -> wait ( true ) ; if ( false === $ this -> shouldCacheEntity ( $ item -> getType ( ) , $ item -> getId ( ) ) ) { return $ entity ; } if ( $ entity ) { $ this -> logger -> ... | Get fresh data with cache . |
55,355 | public function run ( Task $ task ) { $ filters = $ task -> getConfiguration ( ) -> getParameter ( 'filters' ) ; $ sources = $ this -> fetchSources ( $ task ) ; $ destinations = $ this -> fetchDestinations ( $ task ) ; foreach ( $ filters as $ filterName ) { $ filter = $ this -> getFilter ( $ filterName ) ; $ filteredS... | Run a task load its sources before and call the clean method on the filter . |
55,356 | protected function getFilter ( $ name ) { if ( ! array_key_exists ( $ name , $ this -> filters ) ) { throw new Exception ( 'Invalid filter ' . $ name . '. Check your mapping configuration' ) ; } return $ this -> filters [ $ name ] ; } | Return a filter by its name . Throw an exception if it is not exists . |
55,357 | protected function fetchSources ( Task $ task ) { $ sources = [ ] ; foreach ( $ task -> getSources ( ) as $ source ) { $ sources = array_merge ( $ sources , $ this -> locator -> locate ( $ source ) ) ; } return $ sources ; } | Fetch the source files from the task and return and array of SplInfo . |
55,358 | protected function fetchDestinations ( Task $ task ) { $ sources = [ ] ; foreach ( $ task -> getDestinations ( ) as $ source ) { $ sources [ ] = new SplFileInfo ( $ source ) ; } return $ sources ; } | Fetch the destination files from the task and return and array of SplInfo . |
55,359 | protected function filterSources ( array $ sources , FilterInterface $ filter ) { $ filteredSources = [ ] ; if ( ! is_array ( $ filter -> getSupportedExtensions ( ) ) || ! count ( $ filter -> getSupportedExtensions ( ) ) ) { throw new Exception ( 'No supported extensions found for the filter ' . $ filter -> getName ( )... | Filter only the sources supported by the current filter . |
55,360 | protected function updateSources ( array $ originalSources , array $ filteredSources , array $ updatedSources ) { $ sources = [ ] ; $ filteredPath = [ ] ; foreach ( $ filteredSources as $ filteredSource ) { $ filteredPath [ ] = $ filteredSource -> getPath ( ) ; } foreach ( $ originalSources as $ originalSource ) { if (... | Remove the filtered files from the sources and merge with the new ones . |
55,361 | public function urlOfImage ( $ filename , $ width = 300 , $ height = 300 ) { $ url = Config :: get ( 'app.url' ) ; $ url .= '/' ; $ url .= Config :: get ( 'lasallecmsfrontend.images_folder_resized' ) ; $ url .= '/' ; $ url .= $ this -> parseFilenameIntoResizedFilename ( $ filename , $ width , $ height ) ; return $ url ... | Put together the URL of the image . |
55,362 | public function parseFilenameIntoResizedFilename ( $ filename , $ width = 300 , $ height = 300 ) { $ fileNameWithNoExtension = $ this -> filenameWithNoExtension ( $ filename ) ; $ fileNameExtension = $ this -> filenameWithExtensionOnly ( $ filename ) ; $ parsedFilename = "" ; $ parsedFilename .= $ fileNameWithNoExtensi... | Take an image s filename and return the name of the resized file . |
55,363 | public function categoryImageResizedFilename ( $ categoryFeaturedImage ) { $ imageSizes = Config :: get ( 'lasallecmsfrontend.category_featured_image_size' ) ; $ fileNameWithNoExtension = $ this -> filenameWithNoExtension ( $ categoryFeaturedImage ) ; $ fileNameExtension = $ this -> filenameWithExtensionOnly ( $ catego... | What is the name of the resized category featured image that the view will use? |
55,364 | public function createCategoryResizedImageFiles ( $ filename ) { $ filename = $ this -> categoryImageDefaultOrSpecified ( $ filename ) ; $ imageSizes = Config :: get ( 'lasallecmsfrontend.category_featured_image_size' ) ; foreach ( $ imageSizes as $ width => $ height ) { if ( ! $ this -> isFileExist ( $ this -> pathFil... | Create resized image files for the category featured image |
55,365 | public function tagImageResizedFilename ( $ defaultTagImage ) { $ imageSizes = Config :: get ( 'lasallecmsfrontend.default_tag_image_image_size' ) ; $ fileNameWithNoExtension = $ this -> filenameWithNoExtension ( $ defaultTagImage ) ; $ fileNameExtension = $ this -> filenameWithExtensionOnly ( $ defaultTagImage ) ; for... | What is the name of the resized tag default image that the view will use? |
55,366 | public function tagResizedImageFiles ( $ defaultTagImage ) { $ imageSizes = Config :: get ( 'lasallecmsfrontend.default_tag_image_image_size' ) ; foreach ( $ imageSizes as $ width => $ height ) { if ( ! $ this -> isFileExist ( $ this -> pathFilenameOfResizedImage ( $ defaultTagImage , $ width , $ height ) ) ) { $ this ... | Create resized image files for the tag default image |
55,367 | public function resize ( $ filename , $ width , $ height ) { $ img = Image :: make ( $ this -> pathOfImagesUploadFolder ( ) . '/' . $ filename ) ; $ img -> resize ( $ width , $ height , function ( $ constraint ) { $ constraint -> aspectRatio ( ) ; $ constraint -> upsize ( ) ; } ) ; $ img -> save ( $ this -> pathFilenam... | Resize the image using the terrific Intervention package |
55,368 | public function pathFilenameOfResizedImage ( $ filename , $ width , $ height ) { $ path = $ this -> pathOfImagesResizedFolder ( ) ; $ filenameWithNoExtension = $ this -> filenameWithNoExtension ( $ filename ) ; $ filenameWithExtensionOnly = $ this -> filenameWithExtensionOnly ( $ filename ) ; $ resizedFilename = $ path... | Put together the path + name of the resized imaged . |
55,369 | public function getServiceProfile ( $ service ) { if ( isset ( $ this -> serviceProfiles [ $ service ] ) ) { return $ this -> serviceProfiles [ $ service ] ; } return null ; } | Get service profile data |
55,370 | public function exclude ( array $ patterns ) { return $ this -> reject ( function ( $ file ) use ( $ patterns ) { foreach ( $ patterns as $ pattern ) { if ( Str :: is ( $ pattern , $ file [ 'name' ] ) ) return true ; } return false ; } ) ; } | ExcludePattern files with the given patterns . |
55,371 | private function setField ( $ tableSource , $ dtl , $ features , $ fieldLabel ) { if ( $ dtl [ 'COLUMN_NAME' ] == 'host' ) { $ inVl = gethostbyaddr ( $ this -> tCmnRequest -> server -> get ( 'REMOTE_ADDR' ) ) ; return [ 'label' => '<label for="' . $ dtl [ 'COLUMN_NAME' ] . '">Numele calculatorului</label>' , 'input' =>... | Builds field output w . special column name |
55,372 | private function setFieldInput ( $ tableSource , $ dtl , $ features ) { if ( $ dtl [ 'COLUMN_NAME' ] == 'ChoiceId' ) { return '<input type="text" name="ChoiceId" value="' . $ this -> tCmnRequest -> request -> get ( $ dtl [ 'COLUMN_NAME' ] ) . '" />' ; } return $ this -> setNeededFieldByType ( $ tableSource , $ dtl , $ ... | Builds field output w . another special column name |
55,373 | protected function setFormGenericSingleRecord ( $ tblSrc , $ feat , $ hdnInf = [ ] ) { echo $ this -> setStringIntoTag ( '' , 'div' , [ 'id' => 'loading' ] ) ; $ this -> setTableCache ( $ tblSrc ) ; if ( strpos ( $ tblSrc , '.' ) !== false ) { $ tblSrc = explode ( '.' , str_replace ( '`' , '' , $ tblSrc ) ) [ 1 ] ; } $... | Returns a generic form based on a given table |
55,374 | private function setNeededField ( $ tableSource , $ details , $ features ) { if ( isset ( $ features [ 'hidden' ] ) ) { if ( in_array ( $ details [ 'COLUMN_NAME' ] , $ features [ 'hidden' ] ) ) { return null ; } } $ fieldLabel = $ this -> getFieldNameForDisplay ( $ details ) ; if ( $ fieldLabel == 'hidden' ) { return n... | Analyse the field and returns the proper line 2 use in forms |
55,375 | private function setNeededFieldByType ( $ tblName , $ dtls , $ features ) { if ( isset ( $ features [ 'special' ] ) && isset ( $ features [ 'special' ] [ $ dtls [ 'COLUMN_NAME' ] ] ) ) { $ sOpt = $ this -> setMySQLquery2Server ( $ features [ 'special' ] [ $ dtls [ 'COLUMN_NAME' ] ] , 'array_key_value' ) ; return $ this... | Analyse the field type and returns the proper lines 2 use in forms |
55,376 | protected function setViewModernDelete ( $ tbl , $ idn ) { $ tMsg = $ this -> setViewDeleteFeedbacks ( ) ; if ( $ tbl == '' ) { $ sReturn = $ this -> setFeedbackModern ( 'error' , $ tMsg [ 'Confirmation' ] , $ tMsg [ 'Impossible' ] ) ; } else { $ this -> initializeSprGlbAndSession ( ) ; $ idFldVal = $ this -> tCmnSuper... | Automatic handler for Record deletion |
55,377 | protected function findConfiguration ( $ value , \ Closure $ func ) { foreach ( $ this -> all ( ) as $ configuration ) { if ( $ func ( $ configuration , $ value ) ) { return $ configuration ; } } return null ; } | Find a configuration matching custom criteria |
55,378 | public function injectDebugBar ( ResponseInterface $ response ) { $ content = $ response -> getContent ( ) ; $ renderer = $ this -> getJavascriptRenderer ( ) ; $ renderedContent = $ this -> generateAssetsContent ( ) . $ renderer -> render ( ) ; $ pos = strripos ( $ content , '</body>' ) ; if ( false !== $ pos ) { $ con... | Injects the web debug toolbar |
55,379 | public static function environment ( int $ severity , array $ configuration = [ ] ) { $ reporting = ~ E_ALL ; foreach ( self :: SEVERITY as $ key => $ value ) { if ( $ key <= $ severity ) $ reporting |= $ value ; } error_reporting ( $ reporting ) ; if ( isset ( $ configuration [ 'locale' ] ) ) { setlocale ( LC_ALL , $ ... | Global setup of the PHP environment |
55,380 | public function getImageSetBySlug ( $ slug ) { $ imageSet = $ this -> getImageSet ( ) ; foreach ( $ imageSet as $ set ) { if ( $ set -> slug == $ slug ) { return $ set ; } } return null ; } | Get Image by slug |
55,381 | public function addImageSet ( $ postValues ) { $ imageSetObject = ImageSetFactory :: createImageSetFromPostValues ( $ postValues ) ; $ imageSet = $ this -> repository -> imageSet ; $ imageSet [ ] = $ imageSetObject ; $ this -> repository -> imageSet = $ imageSet ; $ this -> save ( ) ; } | Add image set |
55,382 | public function saveImageSet ( $ slug , $ postValues ) { $ imageSetObject = ImageSetFactory :: createImageSetFromPostValues ( $ postValues ) ; $ imageSet = $ this -> repository -> imageSet ; foreach ( $ imageSet as $ key => $ set ) { if ( $ set -> slug == $ slug ) { $ imageSet [ $ key ] = $ imageSetObject ; } } $ this ... | Save Image Set by it s slug |
55,383 | public function deleteImageSetBySlug ( $ slug ) { $ imageSet = $ this -> getImageSet ( ) ; foreach ( $ imageSet as $ key => $ set ) { if ( $ set -> slug == $ slug ) { unset ( $ imageSet [ $ key ] ) ; } } $ imageSet = array_values ( $ imageSet ) ; $ this -> repository -> imageSet = $ imageSet ; $ this -> save ( ) ; } | Delete Image Set by its slug |
55,384 | public function getSmallestImageSet ( ) { $ imageSet = $ this -> getImageSet ( ) ; $ returnSize = PHP_INT_MAX ; $ returnSet = null ; foreach ( $ imageSet as $ set ) { $ size = $ set -> width * $ set -> height ; if ( $ size < $ returnSize ) { $ returnSize = $ size ; $ returnSet = $ set ; } } if ( $ returnSet === null ) ... | Get the image set with the smallest size |
55,385 | public static function setError ( $ prefix = null , $ field , $ error ) { if ( null !== $ prefix && false === is_string ( $ prefix ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ prefix ) ) , E_USER_ERROR ) ; } if ( false === is_string... | Sets an error for the current field |
55,386 | public static function getMessage ( $ field , $ rule ) { if ( false === is_string ( $ field ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ field ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ rule ) ) { return trigger_error ( s... | Returns message by field and rule |
55,387 | public static function loadCustom ( $ classname , $ namespace , $ name ) { if ( false === is_string ( $ classname ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ classname ) ) , E_USER_ERROR ) ; } if ( false === is_string ( $ namespace... | Loads a custom validator class |
55,388 | public static function getErrors ( $ fullnames = false ) { if ( false === is_bool ( $ fullnames ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type boolean, "%s" given' , __METHOD__ , gettype ( $ fullnames ) ) , E_USER_ERROR ) ; } if ( true === $ fullnames ) { return static :: $ errors... | Returns all errors |
55,389 | private static function addMessage ( $ rule , $ params ) { if ( false === is_string ( $ rule ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ rule ) ) , E_USER_ERROR ) ; } if ( false === is_array ( $ params ) ) { return trigger_error ( ... | Adds a new custom message to current fieldname |
55,390 | public function append ( $ data ) { if ( $ data instanceof AbstractToken ) { $ this -> tokens [ ] = $ data ; } elseif ( $ data instanceof AbstractTokenContainer ) { $ this -> tokens = array_merge ( $ this -> tokens , $ data -> toArray ( ) ) ; } elseif ( $ data instanceof AbstractTokenCursor ) { while ( $ data -> valid ... | Append the given token or token container to the TokenBuffer . |
55,391 | public function commit ( ) { $ this -> sourceWidth = $ this -> frameWidth ; $ this -> sourceHeight = $ this -> frameHeight ; $ this -> offsetX = 0 ; $ this -> offsetY = 0 ; $ this -> scaleWidth = $ this -> frameWidth ; $ this -> scaleHeight = $ this -> frameHeight ; $ this -> getFocalPoint ( ) ; } | Resets the image metrics so as to reflect the image should the current settings be applied . |
55,392 | public function getFocalPoint ( ) { $ scale = $ this -> sourceWidth / $ this -> scaleWidth ; $ focalX = ( ( $ this -> frameWidth / 2 ) - $ this -> offsetX ) * $ scale ; $ focalY = ( ( $ this -> frameHeight / 2 ) - $ this -> offsetY ) * $ scale ; return array ( $ focalX , $ focalY ) ; } | Returns an array with the X Y co - ords of the focal point of the current crop . |
55,393 | public function setSourceDetails ( ) { if ( ! file_exists ( $ this -> sourcePath ) ) { throw new FileNotFoundException ( $ this -> sourcePath ) ; } if ( is_dir ( $ this -> sourcePath ) ) { throw new FileNotFoundException ( $ this -> sourcePath ) ; } $ imageDetails = getimagesize ( $ this -> sourcePath ) ; $ this -> sou... | Reads basic information about the metrics of the source image . |
55,394 | public function resize ( $ width , $ height , $ maintainAspect = false , $ scaleUp = true ) { $ oldFrameWidth = $ this -> frameWidth ; $ aspectRatio = $ this -> frameWidth / $ this -> frameHeight ; if ( $ maintainAspect ) { $ newHeight = round ( $ width / $ aspectRatio ) ; if ( $ newHeight > $ height ) { $ newWidth = r... | Resizes the image with the given bounds . |
55,395 | public static function tid ( ) : int { if ( ! ServerUtil :: coroutineIsEnabled ( ) ) { return - 1 ; } $ id = SwCoroutine :: getuid ( ) ; return self :: $ idMap [ $ id ] ?? $ id ; } | get top coroutine id |
55,396 | public static function create ( callable $ cb ) { if ( ! ServerUtil :: coroutineIsEnabled ( ) ) { return false ; } $ tid = self :: tid ( ) ; return SwCoroutine :: create ( function ( ) use ( $ cb , $ tid ) { $ id = SwCoroutine :: getuid ( ) ; self :: $ idMap [ $ id ] = $ tid ; PhpHelper :: call ( $ cb ) ; } ) ; } | create a child coroutine |
55,397 | protected function parseVisibility ( $ visibility ) { if ( is_null ( $ visibility ) ) return null ; switch ( $ visibility ) { case FilesystemContract :: VISIBILITY_PUBLIC : return AdapterInterface :: VISIBILITY_PUBLIC ; case FilesystemContract :: VISIBILITY_PRIVATE : return AdapterInterface :: VISIBILITY_PRIVATE ; } th... | Parse the given visibility value . |
55,398 | static function readObjectCache ( Parser & $ parser , $ key = '' ) { $ parser -> disableCache ( ) ; $ cache = \ ObjectCache :: getInstance ( CACHE_DB ) ; global $ wgDIQAAllowedObjectCacheKeys ; if ( ! isset ( $ wgDIQAAllowedObjectCacheKeys ) || ! in_array ( $ key , $ wgDIQAAllowedObjectCacheKeys ) ) { return 'not-allow... | Read key from ObjectCache |
55,399 | public static function loadClass ( $ className ) { if ( ! class_exists ( $ className ) ) { $ path = self :: getPath ( $ className ) ; $ realPath = stream_resolve_include_path ( $ path ) ; if ( file_exists ( $ realPath ) ) { require_once ( $ realPath ) ; return class_exists ( $ className ) ; } return false ; } else { re... | Loads class . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.