idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
6,100 | public function createOktaDriver ( ) { $ config = $ this -> app [ 'config' ] [ 'services.okta' ] ; $ provider = $ this -> buildProvider ( OktaProvider :: class , $ config ) ; $ provider -> setOktaUrl ( $ config [ 'url' ] ) ; return $ provider ; } | Creates Okta provider and bind it to Laravel Socialite . |
6,101 | public function getImagickDraw ( Drawer $ drawer ) { $ imdraw = new ImagickDraw ( ) ; $ imdraw -> setFont ( $ drawer -> getFont ( ) ) ; $ imdraw -> setFillColor ( $ drawer -> getFontColor ( ) ) ; $ imdraw -> setFontSize ( $ drawer -> getFontSize ( ) ) ; $ imdraw -> setTextAlignment ( $ drawer -> getTextAlign ( ) ) ; re... | Translates the Drawer object to a ImagickDraw . |
6,102 | public function setOpacity ( Imagick $ resource , $ transparency ) { $ alpha = $ transparency / 100 ; if ( $ alpha >= 1 ) { return true ; } $ rows = $ resource -> getPixelIterator ( ) ; foreach ( $ rows as $ cols ) { foreach ( $ cols as $ pixel ) { $ current = $ pixel -> getColorValue ( Imagick :: COLOR_ALPHA ) ; $ pix... | Manually sets the transparency pixel per pixel . |
6,103 | public static function getlastDays ( $ nb = 5 , League $ league = null , $ include_archived = false ) { $ day_storage = \ Drupal :: entityTypeManager ( ) -> getStorage ( 'day' ) ; $ injected_database = Database :: getConnection ( ) ; $ now = new \ DateTime ( null , new \ DateTimeZone ( "UTC" ) ) ; $ query = $ injected_... | Return past days |
6,104 | public function createNativeNamedQuery ( $ queryName ) { $ queryMapping = $ this -> _class -> getNamedNativeQuery ( $ queryName ) ; $ rsm = new Query \ ResultSetMappingBuilder ( $ this -> _em ) ; $ rsm -> addNamedNativeQueryMapping ( $ this -> _class , $ queryMapping ) ; return $ this -> _em -> createNativeQuery ( $ qu... | Creates a native SQL query . |
6,105 | public function newImage ( $ width , $ height , $ background = 'white' ) { $ this -> resource -> createNew ( $ width , $ height , $ background ) ; return $ this ; } | Creates a new blank image . |
6,106 | public function resize ( $ width , $ height , $ bestfit = true , $ stretch = true ) { if ( ! $ stretch and ( ( $ width >= $ this -> getWidth ( ) ) and ( $ height >= $ this -> getHeight ( ) ) ) ) { return $ this ; } $ this -> resource -> resize ( $ width , $ height , $ bestfit , $ stretch ) ; return $ this ; } | Resizes the current image resource . |
6,107 | public function crop ( $ width , $ height , $ coordX , $ coordY ) { $ this -> resource -> crop ( $ width , $ height , $ coordX , $ coordY ) ; return $ this ; } | Crops a portion of the image . |
6,108 | public function thumbnail ( $ width , $ height , $ crop = false , $ stretch = true ) { if ( ! $ stretch and ( ( $ width >= $ this -> getWidth ( ) ) and ( $ height >= $ this -> getHeight ( ) ) ) ) { return $ this ; } $ this -> resource -> thumbnail ( $ width , $ height , $ crop ) ; return $ this ; } | Creates a thumbnail of the current resource . If crop is true the result will be a perfect fit thumbnail with the given dimensions cropped by the center . If crop is false the thumbnail will use the best fit for the dimensions . |
6,109 | public function write ( $ path , $ jpeg_quality = null ) { $ this -> resource -> write ( $ path , $ jpeg_quality ) ; return $ this ; } | Saves the image to disk . If the second param is provided will try to compress the image using JPEG compression . |
6,110 | public function setResource ( ImageResourceInterface $ resource ) { $ this -> resource = $ resource ; if ( $ this -> resource instanceof ImageFilterableInterface ) { $ this -> filterResolver = new FilterResolver ( $ this -> resource -> loadFilters ( ) ) ; } } | Sets the current Image Resource . |
6,111 | public function adjustFontSize ( $ text , Drawer $ drawer , $ width ) { if ( ! ( $ this -> resource instanceof ImageWritableInterface ) ) { throw new UnsupportedMethodException ( "This method is not supported by the ImageResource in use." ) ; } $ fontSize = 0 ; $ metrics [ 'width' ] = 0 ; while ( $ metrics [ 'width' ] ... | Adjusts the font size of the Drawer object to fit a text in the desired width . |
6,112 | public function annotate ( $ text , $ coordX , $ coordY , $ size = null , $ angle = 0 ) { if ( ! ( $ this -> resource instanceof ImageWritableInterface ) ) { throw new UnsupportedMethodException ( "This method is not supported by the ImageResource in use." ) ; } $ drawer = $ this -> getDrawer ( ) ; if ( $ size ) { $ dr... | Writes text to an image . |
6,113 | public function placeImage ( $ image , $ place_constant = Imanee :: IM_POS_TOP_LEFT , $ width = null , $ height = null , $ transparency = 0 ) { if ( ! ( $ this -> resource instanceof ImageComposableInterface ) ) { throw new UnsupportedMethodException ( "This method is not supported by the ImageResource in use." ) ; } i... | Places an image on top of the current resource . If the width and height are supplied will perform a resize before placing the image . |
6,114 | public function watermark ( $ image , $ place_constant = Imanee :: IM_POS_BOTTOM_RIGHT , $ transparency = 0 ) { $ this -> placeImage ( $ image , $ place_constant , 0 , 0 , $ transparency ) ; return $ this ; } | Convenient method to place a watermark image on top of the current resource . |
6,115 | public function addFilter ( FilterInterface $ filter ) { if ( ! ( $ this -> resource instanceof ImageFilterableInterface ) ) { throw new UnsupportedMethodException ( "This method is not supported by the ImageResource in use." ) ; } $ this -> getFilterResolver ( ) -> addFilter ( $ filter ) ; return $ this ; } | Adds a custom filter to the FilterResolver . |
6,116 | public function applyFilter ( $ filter , array $ options = [ ] ) { if ( ! ( $ this -> resource instanceof ImageFilterableInterface ) ) { throw new UnsupportedMethodException ( "This method is not supported by the ImageResource in use." ) ; } $ filter = $ this -> getFilterResolver ( ) -> resolve ( $ filter ) ; if ( ! $ ... | Tries to apply the specified filter to the current resource . |
6,117 | public function removeFrame ( $ offset ) { if ( ! isset ( $ this -> frames [ $ offset ] ) ) { throw new \ InvalidArgumentException ( 'Offset does not exist.' ) ; } unset ( $ this -> frames [ $ offset ] ) ; return $ this ; } | Removes a frame from a list used for generating animated Gifs . |
6,118 | public static function textGen ( $ text , Drawer $ drawer = null , $ format = 'png' , $ background = 'transparent' , ImageResourceInterface $ resource = null ) { $ imanee = new Imanee ( null , $ resource ) ; if ( $ drawer !== null ) { $ imanee -> setDrawer ( $ drawer ) ; } $ size = $ imanee -> resource -> getTextGeomet... | Generates text - only images . |
6,119 | public static function arrayAnimate ( array $ images , $ delay = 20 ) { $ imanee = new Imanee ( ) ; if ( ! ( $ imanee -> resource instanceof ImageAnimatableInterface ) ) { throw new UnsupportedMethodException ( "This method is not supported by the ImageResource in use." ) ; } return $ imanee -> resource -> animate ( $ ... | Generates an animated gif from an array of images . |
6,120 | public static function globAnimate ( $ pattern , $ delay = 20 ) { $ imanee = new Imanee ( ) ; if ( ! ( $ imanee -> resource instanceof ImageAnimatableInterface ) ) { throw new UnsupportedMethodException ( "This method is not supported by the ImageResource in use." ) ; } $ frames = [ ] ; foreach ( glob ( $ pattern ) as ... | Generates an animated gif from image files in a directory . |
6,121 | public static function getImageInfo ( $ imagePath ) { if ( ! is_file ( $ imagePath ) ) { throw new ImageNotFoundException ( sprintf ( "File '%s' not found. Are you sure this is the right path?" , $ imagePath ) ) ; } $ info = getimagesize ( $ imagePath ) ; return [ 'mime' => $ info [ 'mime' ] , 'width' => $ info [ 0 ] ,... | Get info about an image saved in disk . |
6,122 | public function setResultSetMapping ( Query \ ResultSetMapping $ rsm ) { $ this -> translateNamespaces ( $ rsm ) ; $ this -> _resultSetMapping = $ rsm ; return $ this ; } | Sets the ResultSetMapping that should be used for hydration . |
6,123 | private function translateNamespaces ( Query \ ResultSetMapping $ rsm ) { $ translate = function ( $ alias ) { return $ this -> _em -> getClassMetadata ( $ alias ) -> getName ( ) ; } ; $ rsm -> aliasMap = array_map ( $ translate , $ rsm -> aliasMap ) ; $ rsm -> declaringClasses = array_map ( $ translate , $ rsm -> decl... | Allows to translate entity namespaces to full qualified names . |
6,124 | public function getHint ( $ name ) { return isset ( $ this -> _hints [ $ name ] ) ? $ this -> _hints [ $ name ] : false ; } | Gets the value of a query hint . If the hint name is not recognized FALSE is returned . |
6,125 | private function executeUsingQueryCache ( $ parameters = null , $ hydrationMode = null ) { $ rsm = $ this -> getResultSetMapping ( ) ; $ querykey = new QueryCacheKey ( $ this -> getHash ( ) , $ this -> lifetime , $ this -> cacheMode ? : Cache :: MODE_NORMAL ) ; $ queryCache = $ this -> _em -> getCache ( ) -> getQueryCa... | Load from second level cache or executes the query and put into cache . |
6,126 | protected function getHydrationCacheId ( ) { $ parameters = array ( ) ; foreach ( $ this -> getParameters ( ) as $ parameter ) { $ parameters [ $ parameter -> getName ( ) ] = $ this -> processParameterValue ( $ parameter -> getValue ( ) ) ; } $ sql = $ this -> getSQL ( ) ; $ queryCacheProfile = $ this -> getHydrationCa... | Get the result cache id to use to store the result set cache entry . Will return the configured id if it exists otherwise a hash will be automatically generated for you . |
6,127 | protected function getHash ( ) { $ query = $ this -> getSQL ( ) ; $ hints = $ this -> getHints ( ) ; $ params = array_map ( function ( Parameter $ parameter ) { if ( is_scalar ( $ value = $ parameter -> getValue ( ) ) ) { return $ value ; } return $ this -> processParameterValue ( $ value ) ; } , $ this -> parameters -... | Generates a string of currently query to use for the cache second level cache . |
6,128 | public function onKernelException ( GetResponseEvent $ event ) { $ exception = $ event -> getException ( ) ; if ( ! ( $ exception instanceof AccessDeniedHttpException ) ) { return ; } if ( $ this -> route_match -> getRouteName ( ) != 'entity.group.canonical' ) { return ; } drupal_set_message ( t ( 'You are not a member... | Redirects on 403 Access Denied kernel exceptions . |
6,129 | public function addURLs ( $ urls ) { PHPCrawlerBenchmark :: start ( "adding_urls_to_sqlitecache" ) ; $ this -> PDO -> exec ( "BEGIN EXCLUSIVE TRANSACTION;" ) ; $ cnt = count ( $ urls ) ; for ( $ x = 0 ; $ x < $ cnt ; $ x ++ ) { if ( $ urls [ $ x ] != null ) { $ this -> addURL ( $ urls [ $ x ] ) ; } if ( $ x % 1000 == 0... | Adds an bunch of URLs to the url - cache |
6,130 | public function cleanup ( ) { $ this -> PDO = null ; $ this -> PreparedInsertStatement = null ; unlink ( $ this -> sqlite_db_file ) ; } | Cleans up the cache after is it not needed anymore . |
6,131 | private static function convertComparisonOperator ( $ criteriaOperator ) { return isset ( self :: $ operatorMap [ $ criteriaOperator ] ) ? self :: $ operatorMap [ $ criteriaOperator ] : null ; } | Converts Criteria expression to Query one based on static map . |
6,132 | protected function event_status_to_rfc ( ) { if ( ! empty ( $ this -> event_status_mapping [ $ this -> event_status ] ) ) { return $ this -> event_status_mapping [ $ this -> event_status ] ; } return $ this -> event_status_mapping [ 'EventScheduled' ] ; } | This converts the Schema . org enumeration to the RFC spec |
6,133 | protected function event_recurrance_to_rfc ( ) { $ frequency = '' ; switch ( $ this -> repeat ) { case 10 : $ frequency = 'FREQ=WEEKLY' ; break ; case 100 : $ frequency = 'FREQ=MONTHLY' ; break ; case 1000 : $ frequency = 'FREQ=YEARLY' ; break ; } if ( ! empty ( $ frequency ) && ! empty ( $ this -> end_date ) ) { $ fre... | Returns the event recurrence in accordance with the RFC |
6,134 | private function computeSingleEntityChangeSet ( $ entity ) { $ state = $ this -> getEntityState ( $ entity ) ; if ( $ state !== self :: STATE_MANAGED && $ state !== self :: STATE_REMOVED ) { throw new \ InvalidArgumentException ( "Entity has to be managed or scheduled for removal for single computation " . self :: objT... | Only flushes the given entity according to a ruleset that keeps the UoW consistent . |
6,135 | public function getCommitOrderCalculator ( ) { if ( $ this -> commitOrderCalculator === null ) { $ this -> commitOrderCalculator = new Internal \ CommitOrderCalculator ; } return $ this -> commitOrderCalculator ; } | Gets the CommitOrderCalculator used by the UnitOfWork to order commits . |
6,136 | public function getOriginalEntityData ( $ entity ) { $ oid = spl_object_hash ( $ entity ) ; if ( isset ( $ this -> originalEntityData [ $ oid ] ) ) { return $ this -> originalEntityData [ $ oid ] ; } return array ( ) ; } | Gets the original data of an entity . The original data is the data that was present at the time the entity was reconstituted from the database . |
6,137 | public function size ( ) { $ countArray = array_map ( function ( $ item ) { return count ( $ item ) ; } , $ this -> identityMap ) ; return array_sum ( $ countArray ) ; } | Calculates the size of the UnitOfWork . The size of the UnitOfWork is the number of entities in the identity map . |
6,138 | public function isReadOnly ( $ object ) { if ( ! is_object ( $ object ) ) { throw ORMInvalidArgumentException :: readOnlyRequiresManagedEntity ( $ object ) ; } return isset ( $ this -> readOnlyObjects [ spl_object_hash ( $ object ) ] ) ; } | Is this entity read only? |
6,139 | private function afterTransactionComplete ( ) { if ( ! $ this -> hasCache ) { return ; } foreach ( $ this -> persisters as $ persister ) { if ( $ persister instanceof CachedPersister ) { $ persister -> afterTransactionComplete ( ) ; } } foreach ( $ this -> collectionPersisters as $ persister ) { if ( $ persister instan... | Perform whatever processing is encapsulated here after completion of the transaction . |
6,140 | private function afterTransactionRolledBack ( ) { if ( ! $ this -> hasCache ) { return ; } foreach ( $ this -> persisters as $ persister ) { if ( $ persister instanceof CachedPersister ) { $ persister -> afterTransactionRolledBack ( ) ; } } foreach ( $ this -> collectionPersisters as $ persister ) { if ( $ persister in... | Perform whatever processing is encapsulated here after completion of the rolled - back . |
6,141 | private function buildIndexes ( ClassMetadataInfo $ metadata ) { $ tableName = $ metadata -> table [ 'name' ] ; $ indexes = $ this -> tables [ $ tableName ] -> getIndexes ( ) ; foreach ( $ indexes as $ index ) { if ( $ index -> isPrimary ( ) ) { continue ; } $ indexName = $ index -> getName ( ) ; $ indexColumns = $ ind... | Build indexes from a class metadata . |
6,142 | private function buildFieldMapping ( $ tableName , Column $ column ) { $ fieldMapping = array ( 'fieldName' => $ this -> getFieldNameForColumn ( $ tableName , $ column -> getName ( ) , false ) , 'columnName' => $ column -> getName ( ) , 'type' => $ column -> getType ( ) -> getName ( ) , 'nullable' => ( ! $ column -> ge... | Build field mapping from a schema column definition |
6,143 | public function getNamedQuery ( $ name ) { if ( ! isset ( $ this -> _attributes [ 'namedQueries' ] [ $ name ] ) ) { throw ORMException :: namedQueryNotFound ( $ name ) ; } return $ this -> _attributes [ 'namedQueries' ] [ $ name ] ; } | Gets a previously registered named DQL query . |
6,144 | public function addNamedNativeQuery ( $ name , $ sql , Query \ ResultSetMapping $ rsm ) { $ this -> _attributes [ 'namedNativeQueries' ] [ $ name ] = array ( $ sql , $ rsm ) ; } | Adds a named native query to the configuration . |
6,145 | public function getNamedNativeQuery ( $ name ) { if ( ! isset ( $ this -> _attributes [ 'namedNativeQueries' ] [ $ name ] ) ) { throw ORMException :: namedNativeQueryNotFound ( $ name ) ; } return $ this -> _attributes [ 'namedNativeQueries' ] [ $ name ] ; } | Gets the components of a previously registered named native query . |
6,146 | public function getCustomStringFunction ( $ name ) { $ name = strtolower ( $ name ) ; return isset ( $ this -> _attributes [ 'customStringFunctions' ] [ $ name ] ) ? $ this -> _attributes [ 'customStringFunctions' ] [ $ name ] : null ; } | Gets the implementation class name of a registered custom string DQL function . |
6,147 | public function getCustomNumericFunction ( $ name ) { $ name = strtolower ( $ name ) ; return isset ( $ this -> _attributes [ 'customNumericFunctions' ] [ $ name ] ) ? $ this -> _attributes [ 'customNumericFunctions' ] [ $ name ] : null ; } | Gets the implementation class name of a registered custom numeric DQL function . |
6,148 | public function getCustomHydrationMode ( $ modeName ) { return isset ( $ this -> _attributes [ 'customHydrationModes' ] [ $ modeName ] ) ? $ this -> _attributes [ 'customHydrationModes' ] [ $ modeName ] : null ; } | Gets the hydrator class for the given hydration mode name . |
6,149 | public function getDefaultQueryHint ( $ name ) { return isset ( $ this -> _attributes [ 'defaultQueryHints' ] [ $ name ] ) ? $ this -> _attributes [ 'defaultQueryHints' ] [ $ name ] : false ; } | Gets the value of a default query hint . If the hint name is not recognized FALSE is returned . |
6,150 | public function build ( ) { $ cm = $ this -> builder -> getClassMetadata ( ) ; $ cm -> mapEmbedded ( $ this -> mapping ) ; return $ this -> builder ; } | Finalizes this embeddable and attach it to the ClassMetadata . |
6,151 | public function addScalarResult ( $ columnName , $ alias , $ type = 'string' ) { $ this -> scalarMappings [ $ columnName ] = $ alias ; $ this -> typeMappings [ $ columnName ] = $ type ; if ( ! $ this -> isMixed && $ this -> fieldMappings ) { $ this -> isMixed = true ; } return $ this ; } | Adds a scalar result mapping . |
6,152 | public function updateCrawlerStatus ( $ PageInfo , $ abort_reason = null , $ first_content_url = null , $ last_request_time = null ) { PHPCrawlerBenchmark :: start ( "updating_crawler_status" ) ; if ( $ this -> lock_status_updates == true ) { $ sem_key = sem_get ( $ this -> crawler_uniqid ) ; sem_acquire ( $ sem_key ) ... | Updates the status of the crawler |
6,153 | public function postSave ( EntityStorageInterface $ storage , $ update = TRUE ) { parent :: postSave ( $ storage , $ update ) ; if ( \ Drupal :: moduleHandler ( ) -> moduleExists ( 'pathauto' ) ) { \ Drupal :: service ( 'pathauto.generator' ) -> updateEntityAlias ( $ this , 'update' ) ; $ trans = \ Drupal :: service ( ... | Create pathauto aliases for the day |
6,154 | public function getSQLColumnAlias ( $ columnName ) { return $ this -> quoteStrategy -> getColumnAlias ( $ columnName , $ this -> aliasCounter ++ , $ this -> platform ) ; } | Gets an SQL column alias for a column name . |
6,155 | public function walkRangeVariableDeclaration ( $ rangeVariableDeclaration ) { $ class = $ this -> em -> getClassMetadata ( $ rangeVariableDeclaration -> abstractSchemaName ) ; $ dqlAlias = $ rangeVariableDeclaration -> aliasIdentificationVariable ; if ( $ rangeVariableDeclaration -> isRoot ) { $ this -> rootAliases [ ]... | Walks down a RangeVariableDeclaration AST node thereby generating the appropriate SQL . |
6,156 | public function walkCaseExpression ( $ expression ) { switch ( true ) { case ( $ expression instanceof AST \ CoalesceExpression ) : return $ this -> walkCoalesceExpression ( $ expression ) ; case ( $ expression instanceof AST \ NullIfExpression ) : return $ this -> walkNullIfExpression ( $ expression ) ; case ( $ expre... | Walks down a CaseExpression AST node and generates the corresponding SQL . |
6,157 | public function addEntityListener ( $ entityClass , $ listenerClass , $ eventName , $ listenerCallback = null ) { $ this -> entityListeners [ ltrim ( $ entityClass , '\\' ) ] [ ] = array ( 'event' => $ eventName , 'class' => $ listenerClass , 'method' => $ listenerCallback ? : $ eventName ) ; } | Adds a entity listener for a specific entity . |
6,158 | private function getVersionedClassMetadata ( ) { if ( isset ( $ this -> class -> fieldMappings [ $ this -> class -> versionField ] [ 'inherited' ] ) ) { $ definingClassName = $ this -> class -> fieldMappings [ $ this -> class -> versionField ] [ 'inherited' ] ; return $ this -> em -> getClassMetadata ( $ definingClassN... | This function finds the ClassMetadata instance in an inheritance hierarchy that is responsible for enabling versioning . |
6,159 | public function getOwningTable ( $ fieldName ) { if ( isset ( $ this -> owningTableMap [ $ fieldName ] ) ) { return $ this -> owningTableMap [ $ fieldName ] ; } switch ( true ) { case isset ( $ this -> class -> associationMappings [ $ fieldName ] [ 'inherited' ] ) : $ cm = $ this -> em -> getClassMetadata ( $ this -> c... | Gets the name of the table that owns the column the given field is mapped to . |
6,160 | private function addDefaultDiscriminatorMap ( ClassMetadata $ class ) { $ allClasses = $ this -> driver -> getAllClassNames ( ) ; $ fqcn = $ class -> getName ( ) ; $ map = array ( $ this -> getShortName ( $ class -> name ) => $ fqcn ) ; $ duplicates = array ( ) ; foreach ( $ allClasses as $ subClassCandidate ) { if ( i... | Adds a default discriminator map if no one is given |
6,161 | private function getShortName ( $ className ) { if ( strpos ( $ className , "\\" ) === false ) { return strtolower ( $ className ) ; } $ parts = explode ( "\\" , $ className ) ; return strtolower ( end ( $ parts ) ) ; } | Gets the lower - case short name of a class . |
6,162 | private function addNestedEmbeddedClasses ( ClassMetadata $ subClass , ClassMetadata $ parentClass , $ prefix ) { foreach ( $ subClass -> embeddedClasses as $ property => $ embeddableClass ) { if ( isset ( $ embeddableClass [ 'inherited' ] ) ) { continue ; } $ embeddableMetadata = $ this -> getMetadataFor ( $ embeddabl... | Adds nested embedded classes metadata to a parent class . |
6,163 | private function addInheritedIndexes ( ClassMetadata $ subClass , ClassMetadata $ parentClass ) { if ( ! $ parentClass -> isMappedSuperclass ) { return ; } foreach ( array ( 'uniqueConstraints' , 'indexes' ) as $ indexType ) { if ( isset ( $ parentClass -> table [ $ indexType ] ) ) { foreach ( $ parentClass -> table [ ... | Copy the table indices from the parent class superclass to the child class |
6,164 | private function addInheritedNamedQueries ( ClassMetadata $ subClass , ClassMetadata $ parentClass ) { foreach ( $ parentClass -> namedQueries as $ name => $ query ) { if ( ! isset ( $ subClass -> namedQueries [ $ name ] ) ) { $ subClass -> addNamedQuery ( array ( 'name' => $ query [ 'name' ] , 'query' => $ query [ 'qu... | Adds inherited named queries to the subclass mapping . |
6,165 | private function addInheritedNamedNativeQueries ( ClassMetadata $ subClass , ClassMetadata $ parentClass ) { foreach ( $ parentClass -> namedNativeQueries as $ name => $ query ) { if ( ! isset ( $ subClass -> namedNativeQueries [ $ name ] ) ) { $ subClass -> addNamedNativeQuery ( array ( 'name' => $ query [ 'name' ] , ... | Adds inherited named native queries to the subclass mapping . |
6,166 | private function addInheritedSqlResultSetMappings ( ClassMetadata $ subClass , ClassMetadata $ parentClass ) { foreach ( $ parentClass -> sqlResultSetMappings as $ name => $ mapping ) { if ( ! isset ( $ subClass -> sqlResultSetMappings [ $ name ] ) ) { $ entities = array ( ) ; foreach ( $ mapping [ 'entities' ] as $ en... | Adds inherited sql result set mappings to the subclass mapping . |
6,167 | static public function isInternalFunction ( $ functionName ) { $ functionName = strtolower ( $ functionName ) ; return isset ( self :: $ _STRING_FUNCTIONS [ $ functionName ] ) || isset ( self :: $ _DATETIME_FUNCTIONS [ $ functionName ] ) || isset ( self :: $ _NUMERIC_FUNCTIONS [ $ functionName ] ) ; } | Checks if a function is internally defined . Used to prevent overwriting of built - in functions through user - defined functions . |
6,168 | public function getAST ( ) { $ AST = $ this -> QueryLanguage ( ) ; $ this -> processDeferredIdentificationVariables ( ) ; if ( $ this -> deferredPartialObjectExpressions ) { $ this -> processDeferredPartialObjectExpressions ( ) ; } if ( $ this -> deferredPathExpressions ) { $ this -> processDeferredPathExpressions ( $ ... | Parses and builds AST for the given Query . |
6,169 | public function parse ( ) { $ AST = $ this -> getAST ( ) ; if ( ( $ customWalkers = $ this -> query -> getHint ( Query :: HINT_CUSTOM_TREE_WALKERS ) ) !== false ) { $ this -> customTreeWalkers = $ customWalkers ; } if ( ( $ customOutputWalker = $ this -> query -> getHint ( Query :: HINT_CUSTOM_OUTPUT_WALKER ) ) !== fal... | Parses a query string . |
6,170 | private function fixIdentificationVariableOrder ( $ AST ) { if ( count ( $ this -> identVariableExpressions ) <= 1 ) { return ; } foreach ( $ this -> queryComponents as $ dqlAlias => $ qComp ) { if ( ! isset ( $ this -> identVariableExpressions [ $ dqlAlias ] ) ) { continue ; } $ expr = $ this -> identVariableExpressio... | Fixes order of identification variables . |
6,171 | private function isAggregateFunction ( $ tokenType ) { return in_array ( $ tokenType , array ( Lexer :: T_AVG , Lexer :: T_MIN , Lexer :: T_MAX , Lexer :: T_SUM , Lexer :: T_COUNT ) ) ; } | Checks whether the given token type indicates an aggregate function . |
6,172 | private function isNextAllAnySome ( ) { return in_array ( $ this -> lexer -> lookahead [ 'type' ] , array ( Lexer :: T_ALL , Lexer :: T_ANY , Lexer :: T_SOME ) ) ; } | Checks whether the current lookahead token of the lexer has the type T_ALL T_ANY or T_SOME . |
6,173 | public function PathExpression ( $ expectedTypes ) { $ identVariable = $ this -> IdentificationVariable ( ) ; $ field = null ; if ( $ this -> lexer -> isNextToken ( Lexer :: T_DOT ) ) { $ this -> match ( Lexer :: T_DOT ) ; $ this -> match ( Lexer :: T_IDENTIFIER ) ; $ field = $ this -> lexer -> token [ 'value' ] ; whil... | Parses an arbitrary path expression and defers semantical validation based on expected types . |
6,174 | private function CustomFunctionDeclaration ( ) { $ token = $ this -> lexer -> lookahead ; $ funcName = strtolower ( $ token [ 'value' ] ) ; $ config = $ this -> em -> getConfiguration ( ) ; switch ( true ) { case ( $ config -> getCustomStringFunction ( $ funcName ) !== null ) : return $ this -> CustomFunctionsReturning... | Helper function for FunctionDeclaration grammar rule . |
6,175 | public function getFilter ( $ name ) { if ( ! $ this -> isEnabled ( $ name ) ) { throw new \ InvalidArgumentException ( "Filter '" . $ name . "' is not enabled." ) ; } return $ this -> enabledFilters [ $ name ] ; } | Gets an enabled filter from the collection . |
6,176 | public function getHash ( ) { if ( self :: FILTERS_STATE_CLEAN === $ this -> filtersState ) { return $ this -> filterHash ; } $ filterHash = '' ; foreach ( $ this -> enabledFilters as $ name => $ filter ) { $ filterHash .= $ name . $ filter ; } return $ filterHash ; } | Generates a string of currently enabled filters to use for the cache id . |
6,177 | static public function bindEntityListener ( ClassMetadata $ metadata , $ className ) { $ class = $ metadata -> fullyQualifiedClassName ( $ className ) ; if ( ! class_exists ( $ class ) ) { throw MappingException :: entityListenerClassNotFound ( $ class , $ className ) ; } foreach ( get_class_methods ( $ class ) as $ me... | Lookup the entity class to find methods that match to event lifecycle names |
6,178 | public function resolveAssociationEntries ( EntityManagerInterface $ em ) { return array_map ( function ( $ value ) use ( $ em ) { if ( ! ( $ value instanceof AssociationCacheEntry ) ) { return $ value ; } return $ em -> getReference ( $ value -> class , $ value -> identifier ) ; } , $ this -> data ) ; } | Retrieves the entity data resolving cache entries |
6,179 | public function listenToQueue ( array $ handlers , $ routingKey = null , $ options = [ ] ) { $ handlersMap = array ( ) ; foreach ( $ handlers as $ handlerClassPath ) { if ( ! class_exists ( $ handlerClassPath ) ) { $ handlerClassPath = "Kontoulis\\RabbitMQLaravel\\Handlers\\DefaultHandler" ; if ( ! class_exists ( $ han... | Starts to listen to a queue for incoming messages . |
6,180 | public function getDays ( ) { $ query = \ Drupal :: entityQuery ( 'day' ) ; $ query -> condition ( 'league' , $ this -> id ( ) ) ; $ query -> sort ( 'id' , 'ASC' ) ; $ ids = $ query -> execute ( ) ; return Day :: loadMultiple ( $ ids ) ; } | Return all days for league |
6,181 | protected function shouldPassThrough ( $ request ) { foreach ( $ this -> except as $ except ) { if ( $ request -> is ( $ except ) ) { return true ; } } return false ; } | Determine if the request has a URI that should pass through cross origin verification . |
6,182 | public static function buildURLFromParts ( $ url_parts , $ normalize = false ) { if ( ! isset ( $ url_parts [ "host" ] ) ) { throw new Exception ( "Cannot generate URL, host not specified!" ) ; } if ( ! isset ( $ url_parts [ "protocol" ] ) || $ url_parts [ "protocol" ] == "" ) $ url_parts [ "protocol" ] = "http://" ; i... | Builds an URL from it s single parts . |
6,183 | public static function normalizeURL ( $ url ) { $ url_parts = self :: splitURL ( $ url ) ; if ( $ url_parts == null ) return null ; $ url_normalized = self :: buildURLFromParts ( $ url_parts , true ) ; return $ url_normalized ; } | Normalizes an URL |
6,184 | public static function checkRegexPattern ( $ pattern ) { $ check = @ preg_match ( $ pattern , "anything" ) ; if ( is_integer ( $ check ) == false ) return false ; else return true ; } | Checks whether a given RegEx - pattern is valid or not . |
6,185 | public static function getHTTPStatusCode ( $ header ) { $ first_line = strtok ( $ header , "\n" ) ; preg_match ( "# [0-9]{3}#" , $ first_line , $ match ) ; if ( isset ( $ match [ 0 ] ) ) return ( int ) trim ( $ match [ 0 ] ) ; else return null ; } | Gets the HTTP - statuscode from a given response - header . |
6,186 | public static function buildURLFromLink ( $ link , PHPCrawlerUrlPartsDescriptor $ BaseUrl ) { $ url_parts = $ BaseUrl -> toArray ( ) ; $ link = PHPCrawlerEncodingUtils :: decodeHtmlEntities ( $ link ) ; $ link = preg_replace ( "/^(.{1,})#.{0,}$/" , "\\1" , $ link ) ; if ( substr ( $ link , 0 , 2 ) == "//" ) { $ link = ... | Reconstructs a full qualified and normalized URL from a given link relating to the URL the link was found in . |
6,187 | public static function getBaseUrlFromMetaTag ( & $ html_source ) { preg_match ( "#<{1}[ ]{0,}((?i)base){1}[ ]{1,}((?i)href|src)[ ]{0,}=[ ]{0,}(\"|'){0,1}([^\"'><\n ]{0,})(\"|'|>|<|\n| )# i" , $ html_source , $ match ) ; if ( isset ( $ match [ 4 ] ) ) { $ match [ 4 ] = trim ( $ match [ 4 ] ) ; return $ match [ 4 ] ; } e... | Returns the base - URL specified in a meta - tag in the given HTML - source |
6,188 | public static function getRedirectURLFromHeader ( & $ header ) { preg_match ( "/((?i)location:|content-location:)(.{0,})[\n]/" , $ header , $ match ) ; if ( isset ( $ match [ 2 ] ) ) { $ redirect = trim ( $ match [ 2 ] ) ; return $ redirect ; } else return null ; } | Returns the redirect - URL from the given HTML - header |
6,189 | public static function checkStringAgainstRegexArray ( & $ string , $ regex_array ) { if ( count ( $ regex_array ) == 0 ) return true ; $ cnt = count ( $ regex_array ) ; for ( $ x = 0 ; $ x < $ cnt ; $ x ++ ) { if ( preg_match ( $ regex_array [ $ x ] , $ string ) ) { return true ; } } return false ; } | Checks whether a given string matches with one of the given regular - expressions . |
6,190 | public static function getHeaderValue ( $ header , $ directive ) { preg_match ( "#[\r\n]" . $ directive . ":(.*)[\r\n\;]# Ui" , $ header , $ match ) ; if ( isset ( $ match [ 1 ] ) && trim ( $ match [ 1 ] ) != "" ) { return trim ( $ match [ 1 ] ) ; } else return null ; } | Gets the value of an header - directive from the given HTTP - header . |
6,191 | public static function getCookiesFromHeader ( $ header , $ source_url ) { $ cookies = array ( ) ; $ hits = preg_match_all ( "#[\r\n]set-cookie:(.*)[\r\n]# Ui" , $ header , $ matches ) ; if ( $ hits && $ hits != 0 ) { for ( $ x = 0 ; $ x < count ( $ matches [ 1 ] ) ; $ x ++ ) { $ cookies [ ] = PHPCrawlerCookieDescriptor... | Returns all cookies from the give response - header . |
6,192 | public static function getRootUrl ( $ url ) { $ url_parts = self :: splitURL ( $ url ) ; $ root_url = $ url_parts [ "protocol" ] . $ url_parts [ "host" ] . ":" . $ url_parts [ "port" ] ; return self :: normalizeURL ( $ root_url ) ; } | Returns the normalized root - URL of the given URL |
6,193 | public static function deserializeFromFile ( $ file ) { if ( file_exists ( $ file ) ) { $ serialized_data = file_get_contents ( $ file ) ; return unserialize ( $ serialized_data ) ; } else return null ; } | Returns deserialized data that is stored in a file . |
6,194 | public static function sort2dArray ( & $ array , $ sort_args ) { $ args = func_get_args ( ) ; @ reset ( $ array ) ; while ( list ( $ field ) = @ each ( $ array ) ) { for ( $ x = 1 ; $ x < count ( $ args ) ; $ x ++ ) { if ( is_string ( $ args [ $ x ] ) ) { $ value = $ array [ $ field ] [ $ args [ $ x ] ] ; $ { $ args [ ... | Sorts a twodimensiolnal array . |
6,195 | public static function getMetaTagAttributes ( & $ html_source ) { preg_match_all ( "#<\s*meta\s+" . "name\s*=\s*(?|\"([^\"]+)\"|'([^']+)'|([^\s><'\"]+))\s+" . "content\s*=\s*(?|\"([^\"]+)\"|'([^']+)'|([^\s><'\"]+))" . ".*># Uis" , $ html_source , $ matches ) ; $ tags = array ( ) ; for ( $ x = 0 ; $ x < count ( $ matche... | Gets all meta - tag atteributes from the given HTML - source . |
6,196 | public static function getURIContent ( $ uri , $ request_user_agent_string = null , $ throw_exception = false ) { $ UriParts = PHPCrawlerUrlPartsDescriptor :: fromURL ( $ uri ) ; $ error_str = "" ; if ( $ UriParts -> protocol == "file://" ) { $ file = preg_replace ( "#^file://#" , "" , $ uri ) ; if ( file_exists ( $ fi... | Gets the content from the given file or URL |
6,197 | public function setMappedSuperClass ( ) { $ this -> cm -> isMappedSuperclass = true ; $ this -> cm -> isEmbeddedClass = false ; return $ this ; } | Marks the class as mapped superclass . |
6,198 | public function setEmbeddable ( ) { $ this -> cm -> isEmbeddedClass = true ; $ this -> cm -> isMappedSuperclass = false ; return $ this ; } | Marks the class as embeddable . |
6,199 | public function addEmbedded ( $ fieldName , $ class , $ columnPrefix = null ) { $ this -> cm -> mapEmbedded ( array ( 'fieldName' => $ fieldName , 'class' => $ class , 'columnPrefix' => $ columnPrefix ) ) ; return $ this ; } | Adds and embedded class |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.