idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
58,800 | protected function processSplObjectStorage ( \ SplObjectStorage $ splObjectStorage = null , $ parentIdentifier , array $ previousObjectStorage = null ) { if ( $ previousObjectStorage !== null && is_array ( $ previousObjectStorage [ 'value' ] ) ) { $ this -> removeDeletedSplObjectStorageEntries ( $ splObjectStorage , $ ... | Store an SplObjectStorage as a set of records . |
58,801 | public function formatDateTimeWithCustomPattern ( \ DateTimeInterface $ dateTime , $ format , Locale $ locale ) { return $ this -> doFormattingWithParsedFormat ( $ dateTime , $ this -> datesReader -> parseCustomFormat ( $ format ) , $ this -> datesReader -> getLocalizedLiteralsForLocale ( $ locale ) ) ; } | Returns dateTime formatted by custom format string provided in parameter . |
58,802 | public function formatDate ( \ DateTimeInterface $ date , Locale $ locale , $ formatLength = DatesReader :: FORMAT_LENGTH_DEFAULT ) { DatesReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doFormattingWithParsedFormat ( $ date , $ this -> datesReader -> parseFormatFromCldr ( $ locale , DatesReader ::... | Formats date with format string for date defined in CLDR for particular locale . |
58,803 | public function formatTime ( \ DateTimeInterface $ time , Locale $ locale , $ formatLength = DatesReader :: FORMAT_LENGTH_DEFAULT ) { DatesReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doFormattingWithParsedFormat ( $ time , $ this -> datesReader -> parseFormatFromCldr ( $ locale , DatesReader ::... | Formats time with format string for time defined in CLDR for particular locale . |
58,804 | public function formatDateTime ( \ DateTimeInterface $ dateTime , Locale $ locale , $ formatLength = DatesReader :: FORMAT_LENGTH_DEFAULT ) { DatesReader :: validateFormatLength ( $ formatLength ) ; return $ this -> doFormattingWithParsedFormat ( $ dateTime , $ this -> datesReader -> parseFormatFromCldr ( $ locale , Da... | Formats dateTime with format string for date and time defined in CLDR for particular locale . |
58,805 | protected function doFormattingWithParsedFormat ( \ DateTimeInterface $ dateTime , array $ parsedFormat , array $ localizedLiterals ) { $ formattedDateTime = '' ; foreach ( $ parsedFormat as $ subformat ) { if ( is_array ( $ subformat ) ) { $ formattedDateTime .= $ subformat [ 0 ] ; } else { $ formattedDateTime .= $ th... | Formats provided dateTime object . |
58,806 | public function getMessages ( $ severity = null ) { if ( $ severity === null ) { return $ this -> messages ; } $ messages = [ ] ; foreach ( $ this -> messages as $ message ) { if ( $ message -> getSeverity ( ) === $ severity ) { $ messages [ ] = $ message ; } } return $ messages ; } | Returns all currently stored flash messages . |
58,807 | public function flush ( $ severity = null ) { if ( $ severity === null ) { $ this -> messages = [ ] ; } else { foreach ( $ this -> messages as $ index => $ message ) { if ( $ message -> getSeverity ( ) === $ severity ) { unset ( $ this -> messages [ $ index ] ) ; } } } } | Remove messages from this container . |
58,808 | public function sort ( ) { if ( $ this -> sortedPackages === null ) { $ this -> sortedPackages = [ ] ; reset ( $ this -> unsortedPackages ) ; while ( ! empty ( $ this -> unsortedPackages ) ) { $ resolved = $ this -> sortPackage ( key ( $ this -> unsortedPackages ) ) ; if ( $ resolved ) { reset ( $ this -> unsortedPacka... | Sorts the packages and returns the sorted packages array |
58,809 | protected function sortPackage ( $ packageKey ) { if ( ! isset ( $ this -> packageStates [ $ packageKey ] ) ) { return true ; } if ( ! isset ( $ this -> unsortedPackages [ $ packageKey ] ) ) { return true ; } $ iterationForPackage = $ this -> unsortedPackages [ $ packageKey ] ; if ( $ iterationForPackage === - 1 ) { re... | Recursively sort dependencies of a package . This is a depth - first approach that recursively adds all dependent packages to the sorted list before adding the given package . Visited packages are flagged to break up cyclic dependencies . |
58,810 | private function Flow_searchForEntitiesAndStoreIdentifierArray ( $ path , $ propertyValue , $ originalPropertyName ) { if ( is_array ( $ propertyValue ) || ( is_object ( $ propertyValue ) && ( $ propertyValue instanceof \ ArrayObject || $ propertyValue instanceof \ SplObjectStorage ) ) ) { foreach ( $ propertyValue as ... | Serialize entities that are inside an array or SplObjectStorage |
58,811 | protected function pushResult ( ) { if ( $ this -> result !== null ) { array_push ( $ this -> resultStack , $ this -> result ) ; } $ this -> result = new ErrorResult ( ) ; return $ this -> result ; } | Push a new Result onto the Result stack and return it in order to fix cyclic calls to a single validator . |
58,812 | public function validate ( $ value ) { $ this -> pushResult ( ) ; if ( $ this -> acceptsEmptyValues === false || $ this -> isEmpty ( $ value ) === false ) { $ this -> isValid ( $ value ) ; } return $ this -> popResult ( ) ; } | Checks if the given value is valid according to the validator and returns the Error Messages object which occurred . |
58,813 | public function setFilename ( $ filename ) { $ this -> throwExceptionIfProtected ( ) ; $ pathInfo = UnicodeFunctions :: pathinfo ( $ filename ) ; $ extension = ( isset ( $ pathInfo [ 'extension' ] ) ? '.' . strtolower ( $ pathInfo [ 'extension' ] ) : '' ) ; $ this -> filename = $ pathInfo [ 'filename' ] . $ extension ;... | Sets the filename which is used when this resource is downloaded or saved as a file |
58,814 | public function getMediaType ( ) { if ( $ this -> mediaType === null ) { return Utility \ MediaTypes :: getMediaTypeFromFilename ( $ this -> filename ) ; } else { return $ this -> mediaType ; } } | Returns the Media Type for this resource |
58,815 | public function setSha1 ( $ sha1 ) { $ this -> throwExceptionIfProtected ( ) ; if ( ! is_string ( $ sha1 ) || preg_match ( '/[A-Fa-f0-9]{40}/' , $ sha1 ) !== 1 ) { throw new \ InvalidArgumentException ( 'Specified invalid hash to setSha1()' , 1362564220 ) ; } $ this -> sha1 = strtolower ( $ sha1 ) ; } | Sets the SHA1 hash of the content of this resource |
58,816 | public function createTemporaryLocalCopy ( ) { if ( $ this -> temporaryLocalCopyPathAndFilename === null ) { $ temporaryPathAndFilename = $ this -> environment -> getPathToTemporaryDirectory ( ) . 'ResourceFiles/' ; try { Utility \ Files :: createDirectoryRecursively ( $ temporaryPathAndFilename ) ; } catch ( Utility \... | Returns the path to a local file representing this resource for use with read - only file operations such as reading or copying . |
58,817 | public function postPersist ( ) { if ( $ this -> lifecycleEventsActive ) { $ collection = $ this -> resourceManager -> getCollection ( $ this -> collectionName ) ; $ collection -> getTarget ( ) -> publishResource ( $ this , $ collection ) ; } } | Doctrine lifecycle event callback which is triggered on postPersist events . This method triggers the publication of this resource . |
58,818 | public function preRemove ( ) { if ( $ this -> lifecycleEventsActive && $ this -> deleted === false ) { $ this -> resourceManager -> deleteResource ( $ this ) ; } } | Doctrine lifecycle event callback which is triggered on preRemove events . This method triggers the deletion of data related to this resource . |
58,819 | public function invoke ( JoinPointInterface $ joinPoint ) { if ( $ this -> runtimeEvaluator !== null && $ this -> runtimeEvaluator -> __invoke ( $ joinPoint , $ this -> objectManager ) === false ) { return $ joinPoint -> getAdviceChain ( ) -> proceed ( $ joinPoint ) ; } $ adviceObject = $ this -> objectManager -> get (... | Invokes the advice method |
58,820 | public function getParsedData ( string $ sourcePath ) { if ( ! isset ( $ this -> parsedFiles [ $ sourcePath ] ) ) { $ this -> parsedFiles [ $ sourcePath ] = $ this -> parseXmlFile ( $ sourcePath ) ; } return $ this -> parsedFiles [ $ sourcePath ] ; } | Returns parsed representation of XML file . |
58,821 | protected function parseXmlFile ( string $ sourcePath ) { $ rootXmlNode = $ this -> getRootNode ( $ sourcePath ) ; return $ this -> doParsingFromRoot ( $ rootXmlNode ) ; } | Reads and parses XML file and returns internal representation of data . |
58,822 | protected function echoExceptionWeb ( $ exception ) { $ statusCode = ( $ exception instanceof WithHttpStatusInterface ) ? $ exception -> getStatusCode ( ) : 500 ; $ statusMessage = ResponseInformationHelper :: getStatusMessageByCode ( $ statusCode ) ; if ( ! headers_sent ( ) ) { header ( sprintf ( 'HTTP/1.1 %s %s' , $ ... | Formats and echoes the exception as XHTML . |
58,823 | public function matchRequest ( RequestInterface $ request ) { if ( ! isset ( $ this -> options [ 'cidrPattern' ] ) ) { throw new InvalidRequestPatternException ( 'Missing option "cidrPattern" in the Ip request pattern configuration' , 1446224520 ) ; } if ( ! $ request instanceof ActionRequest ) { return false ; } retur... | Matches a \ Neos \ Flow \ Mvc \ RequestInterface against the set IP pattern rules |
58,824 | public function authenticateAction ( ) { $ authenticationException = null ; try { $ this -> authenticationManager -> authenticate ( ) ; } catch ( AuthenticationRequiredException $ exception ) { $ authenticationException = $ exception ; } if ( ! $ this -> authenticationManager -> isAuthenticated ( ) ) { $ this -> onAuth... | Calls the authentication manager to authenticate all active tokens and redirects to the original intercepted request on success if there is one stored in the security context . If no intercepted request is found the function simply returns . |
58,825 | public function intersect ( ClassNameIndex $ classNameIndex ) : ClassNameIndex { return new ClassNameIndex ( array_intersect_key ( $ this -> classNames , $ classNameIndex -> classNames ) ) ; } | Returns a new index object with all class names contained in this and the given index |
58,826 | public function applyIntersect ( ClassNameIndex $ classNameIndex ) : void { $ this -> classNames = array_intersect_key ( $ this -> classNames , $ classNameIndex -> classNames ) ; } | Sets this index to all class names which are present currently and contained in the given index |
58,827 | public function union ( ClassNameIndex $ classNameIndex ) : ClassNameIndex { $ result = clone $ classNameIndex ; $ result -> applyUnion ( $ this ) ; return $ result ; } | Returns a new index object containing all class names of this index and the given one |
58,828 | public function applyUnion ( ClassNameIndex $ classNameIndex ) : void { if ( count ( $ this -> classNames ) > count ( $ classNameIndex -> classNames ) ) { foreach ( $ classNameIndex -> classNames as $ className => $ value ) { $ this -> classNames [ $ className ] = true ; } } else { $ unionClassNames = $ classNameIndex ... | Sets this index to all class names which are either already present or are contained in the given index |
58,829 | public function filterByPrefix ( string $ prefixFilter ) : ClassNameIndex { $ pointcuts = array_keys ( $ this -> classNames ) ; $ result = new ClassNameIndex ( ) ; $ right = count ( $ pointcuts ) - 1 ; $ left = 0 ; $ found = false ; $ currentPosition = - 1 ; while ( $ found === false ) { if ( $ left > $ right ) { break... | Returns a new index object which contains all class names of this index starting with the given prefix |
58,830 | public function setTemplatePathAndFilename ( $ templatePathAndFilename ) { $ this -> baseRenderingContext -> getTemplatePaths ( ) -> setTemplatePathAndFilename ( $ templatePathAndFilename ) ; $ partialRootPaths = $ this -> baseRenderingContext -> getTemplatePaths ( ) -> getPartialRootPaths ( ) ; $ layoutRootPaths = $ t... | Sets the absolute path to a Fluid template file |
58,831 | public function hasTemplate ( ) { try { $ this -> baseRenderingContext -> getTemplatePaths ( ) -> getTemplateSource ( $ this -> baseRenderingContext -> getControllerName ( ) , $ this -> baseRenderingContext -> getControllerAction ( ) ) ; return true ; } catch ( InvalidTemplateResourceException $ e ) { return false ; } ... | Checks whether a template can be resolved for the current request |
58,832 | protected function translateByShortHandString ( $ shortHandString ) { $ shortHandStringParts = explode ( ':' , $ shortHandString ) ; if ( count ( $ shortHandStringParts ) === 3 ) { list ( $ package , $ source , $ id ) = $ shortHandStringParts ; return $ this -> createTranslationParameterToken ( $ id ) -> package ( $ pa... | Translate by shorthand string |
58,833 | public static function getMediaTypeFromFilename ( string $ filename ) : string { $ pathinfo = pathinfo ( strtolower ( $ filename ) ) ; if ( ! isset ( $ pathinfo [ 'extension' ] ) ) { return 'application/octet-stream' ; } return self :: $ extensionToMediaType [ $ pathinfo [ 'extension' ] ] ?? 'application/octet-stream' ... | Returns a Media Type based on the filename extension |
58,834 | public static function getMediaTypeFromFileContent ( string $ fileContent ) : string { $ fileInfo = new \ finfo ( FILEINFO_MIME ) ; $ mediaType = self :: trimMediaType ( $ fileInfo -> buffer ( $ fileContent ) ) ; return isset ( self :: $ mediaTypeToFileExtension [ $ mediaType ] ) ? $ mediaType : 'application/octet-stre... | Returns a Media Type based on the file content |
58,835 | public static function parseMediaType ( string $ rawMediaType ) : array { preg_match ( self :: PATTERN_SPLITMEDIATYPE , $ rawMediaType , $ matches ) ; $ result = [ ] ; $ result [ 'type' ] = $ matches [ 'type' ] ?? '' ; $ result [ 'subtype' ] = $ matches [ 'subtype' ] ?? '' ; $ result [ 'parameters' ] = [ ] ; if ( isset... | Parses a RFC 2616 Media Type and returns its parts in an associative array . |
58,836 | public static function mediaRangeMatches ( string $ mediaRange , string $ mediaType ) : bool { preg_match ( self :: PATTERN_SPLITMEDIARANGE , $ mediaRange , $ mediaRangeMatches ) ; preg_match ( self :: PATTERN_SPLITMEDIATYPE , $ mediaType , $ mediaTypeMatches ) ; if ( $ mediaRangeMatches === [ ] || $ mediaTypeMatches =... | Checks if the given media range and the media type match . |
58,837 | public function configureEntityManager ( Connection $ connection , Configuration $ config , EventManager $ eventManager ) { if ( isset ( $ this -> settings [ 'doctrine' ] [ 'sqlLogger' ] ) && is_string ( $ this -> settings [ 'doctrine' ] [ 'sqlLogger' ] ) && class_exists ( $ this -> settings [ 'doctrine' ] [ 'sqlLogger... | Configure the Doctrine EntityManager according to configuration settings before it s creation . |
58,838 | protected function applyDqlSettingsToConfiguration ( array $ configuredSettings , Configuration $ doctrineConfiguration ) { if ( isset ( $ configuredSettings [ 'customStringFunctions' ] ) ) { $ doctrineConfiguration -> setCustomStringFunctions ( $ configuredSettings [ 'customStringFunctions' ] ) ; } if ( isset ( $ conf... | Apply configured settings regarding DQL to the Doctrine Configuration . At the moment these are custom DQL functions . |
58,839 | protected function applyCacheConfiguration ( Configuration $ config ) { $ cache = new CacheAdapter ( ) ; $ cache -> setCache ( $ this -> objectManager -> get ( CacheManager :: class ) -> getCache ( 'Flow_Persistence_Doctrine' ) ) ; $ config -> setMetadataCacheImpl ( $ cache ) ; $ config -> setQueryCacheImpl ( $ cache )... | Apply basic cache configuration for the metadata query and result caches . |
58,840 | protected function applySecondLevelCacheSettingsToConfiguration ( array $ configuredSettings , Configuration $ doctrineConfiguration ) { if ( ! isset ( $ configuredSettings [ 'enable' ] ) || $ configuredSettings [ 'enable' ] !== true ) { return ; } $ doctrineConfiguration -> setSecondLevelCacheEnabled ( ) ; $ regionsCo... | Apply configured settings regarding Doctrine s second level cache . |
58,841 | public function enhanceEntityManager ( Configuration $ config , EntityManager $ entityManager ) { if ( isset ( $ this -> settings [ 'doctrine' ] [ 'dbal' ] [ 'mappingTypes' ] ) && is_array ( $ this -> settings [ 'doctrine' ] [ 'dbal' ] [ 'mappingTypes' ] ) ) { foreach ( $ this -> settings [ 'doctrine' ] [ 'dbal' ] [ 'm... | Enhance the Doctrine EntityManager by applying post creation settings like custom filters . |
58,842 | protected function convertToCharacterSetAndCollation ( string $ characterSet , string $ collation , string $ outputPathAndFilename = null , bool $ verbose = false ) { $ statements = [ 'SET foreign_key_checks = 0' ] ; $ statements [ ] = 'ALTER DATABASE ' . $ this -> connection -> quoteIdentifier ( $ this -> persistenceS... | Convert the tables in the current database to use given character set and collation . |
58,843 | protected function prepareErrorResponse ( $ exception , Http \ Response $ response ) { $ pathPosition = strpos ( $ exception -> getFile ( ) , 'Packages/' ) ; $ filePathAndName = ( $ pathPosition !== false ) ? substr ( $ exception -> getFile ( ) , $ pathPosition ) : $ exception -> getFile ( ) ; $ exceptionCodeNumber = (... | Prepare a response in case an error occurred . |
58,844 | protected function findObjectByIdentityProperties ( array $ identityProperties , $ type ) { $ query = $ this -> persistenceManager -> createQueryForType ( $ type ) ; $ classSchema = $ this -> reflectionService -> getClassSchema ( $ type ) ; $ equals = [ ] ; foreach ( $ classSchema -> getIdentityProperties ( ) as $ prop... | Finds an object from the repository by searching for its identity properties . |
58,845 | public function resolveInterceptorClass ( $ name ) { $ resolvedClassName = $ this -> objectManager -> getClassNameByObjectName ( $ name ) ; if ( $ resolvedClassName !== false ) { return $ resolvedClassName ; } $ resolvedClassName = $ this -> objectManager -> getClassNameByObjectName ( 'Neos\Flow\Security\Authorization\... | Resolves the class name of a security interceptor . If a valid interceptor class name is given it is just returned . |
58,846 | protected function getClassSchema ( $ className ) { $ classSchema = $ this -> reflectionService -> getClassSchema ( $ className ) ; if ( ! $ classSchema ) { throw new ClassSchemaNotFoundException ( 'No class schema found for "' . $ className . '".' , 1295973082 ) ; } return $ classSchema ; } | Fetch a class schema for the given class if possible . |
58,847 | public function inferTableNameFromClassName ( $ className , $ lengthLimit = null ) { return $ this -> truncateIdentifier ( strtolower ( str_replace ( '\\' , '_' , $ className ) ) , $ lengthLimit , $ className ) ; } | Given a class name a table name is returned . That name should be reasonably unique . |
58,848 | protected function truncateIdentifier ( $ identifier , $ lengthLimit = null , $ hashSource = null ) { if ( $ lengthLimit === null ) { $ lengthLimit = $ this -> getMaxIdentifierLength ( ) ; } if ( strlen ( $ identifier ) > $ lengthLimit ) { $ identifier = substr ( $ identifier , 0 , $ lengthLimit - 6 ) . '_' . substr ( ... | Truncate an identifier if needed and append a hash to ensure uniqueness . |
58,849 | protected function inferJoinTableNameFromClassAndPropertyName ( $ className , $ propertyName ) { $ prefix = $ this -> inferTableNameFromClassName ( $ className ) ; $ suffix = '_' . strtolower ( $ propertyName . '_join' ) ; if ( strlen ( $ prefix . $ suffix ) > $ this -> getMaxIdentifierLength ( ) ) { $ prefix = $ this ... | Given a class and property name a table name is returned . That name should be reasonably unique . |
58,850 | protected function buildJoinTableColumnName ( $ className ) { if ( preg_match ( '/^(?P<PackageNamespace>\w+(?:\\\\\w+)*)\\\\Domain\\\\Model\\\\(?P<ModelNamePrefix>(\w+\\\\)?)(?P<ModelName>\w+)$/' , $ className , $ matches ) ) { $ packageNamespaceParts = explode ( '\\' , $ matches [ 'PackageNamespace' ] ) ; $ tableName ... | Build a name for a column in a jointable . |
58,851 | protected function evaluateJoinTableAnnotation ( ORM \ JoinTable $ joinTableAnnotation , \ ReflectionProperty $ property , $ className , array $ mapping ) { $ joinTable = [ 'name' => $ joinTableAnnotation -> name , 'schema' => $ joinTableAnnotation -> schema ] ; if ( $ joinTable [ 'name' ] === null ) { $ joinTable [ 'n... | Evaluate JoinTable annotations and fill missing bits as needed . |
58,852 | protected function evaluateOverridesAnnotations ( array $ classAnnotations , ORM \ ClassMetadataInfo $ metadata ) { if ( isset ( $ classAnnotations [ ORM \ AssociationOverrides :: class ] ) ) { $ associationOverridesAnnotation = $ classAnnotations [ ORM \ AssociationOverrides :: class ] ; foreach ( $ associationOverrid... | Evaluate the association overrides annotations and amend the metadata accordingly . |
58,853 | protected function evaluateEntityListenersAnnotation ( \ ReflectionClass $ class , ORM \ ClassMetadata $ metadata , array $ classAnnotations ) { if ( isset ( $ classAnnotations [ ORM \ EntityListeners :: class ] ) ) { $ entityListenersAnnotation = $ classAnnotations [ ORM \ EntityListeners :: class ] ; foreach ( $ enti... | Evaluate the EntityListeners annotation and amend the metadata accordingly . |
58,854 | protected function evaluateLifeCycleAnnotations ( \ ReflectionClass $ class , ORM \ ClassMetadataInfo $ metadata ) { foreach ( $ class -> getMethods ( ) as $ method ) { if ( $ method -> isPublic ( ) ) { foreach ( $ this -> getMethodCallbacks ( $ method ) as $ value ) { $ metadata -> addLifecycleCallback ( $ value [ 0 ]... | Evaluate the lifecycle annotations and amend the metadata accordingly . |
58,855 | protected function getMethodCallbacks ( \ ReflectionMethod $ method ) { $ callbacks = [ ] ; $ annotations = $ this -> reader -> getMethodAnnotations ( $ method ) ; foreach ( $ annotations as $ annotation ) { if ( $ annotation instanceof ORM \ PrePersist ) { $ callbacks [ ] = [ $ method -> name , Events :: prePersist ] ... | Returns an array of callbacks for lifecycle annotations on the given method . |
58,856 | protected function getMaxIdentifierLength ( ) { if ( $ this -> tableNameLengthLimit === null ) { $ this -> tableNameLengthLimit = $ this -> entityManager -> getConnection ( ) -> getDatabasePlatform ( ) -> getMaxIdentifierLength ( ) ; } return $ this -> tableNameLengthLimit ; } | Derive maximum identifier length from doctrine DBAL |
58,857 | protected function joinColumnToArray ( ORM \ JoinColumn $ joinColumnAnnotation , $ propertyName = null ) { return [ 'name' => $ joinColumnAnnotation -> name === null ? $ propertyName : $ joinColumnAnnotation -> name , 'unique' => $ joinColumnAnnotation -> unique , 'nullable' => $ joinColumnAnnotation -> nullable , 'onD... | Parse the given JoinColumn into an array |
58,858 | protected function addColumnToMappingArray ( ORM \ Column $ columnAnnotation , array $ mapping = [ ] , $ fieldName = null ) { if ( $ fieldName !== null ) { $ mapping [ 'fieldName' ] = $ fieldName ; } $ mapping [ 'type' ] = ( $ columnAnnotation -> type === 'string' ) ? null : $ columnAnnotation -> type ; $ mapping [ 'sc... | Parse the given Column into an array |
58,859 | public function matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) { $ class = new \ ReflectionClass ( $ className ) ; foreach ( $ class -> getProperties ( ) as $ property ) { if ( $ this -> reader -> getPropertyAnnotation ( $ property , ORM \ Id :: class ) !== null ) { retu... | Checks if the specified class has a property annotated with Id |
58,860 | public function matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) : bool { if ( $ this -> pointcut === null ) { $ this -> pointcut = $ this -> proxyClassBuilder -> findPointcut ( $ this -> aspectClassName , $ this -> pointcutMethodName ) ; } if ( $ this -> pointcut === fals... | Checks if the specified class and method matches with the pointcut |
58,861 | public function getRuntimeEvaluationsDefinition ( ) : array { if ( $ this -> pointcut === null ) { $ this -> pointcut = $ this -> proxyClassBuilder -> findPointcut ( $ this -> aspectClassName , $ this -> pointcutMethodName ) ; } if ( $ this -> pointcut === false ) { return [ ] ; } return $ this -> pointcut -> getRuntim... | Returns runtime evaluations for the pointcut . |
58,862 | public function matches ( $ className , $ methodName , $ methodDeclaringClassName , $ pointcutQueryIdentifier ) : bool { $ matchResult = preg_match ( '/^' . $ this -> methodNameFilterExpression . '$/' , $ methodName ) ; if ( $ matchResult === false ) { throw new Exception ( 'Error in regular expression' , 1168876915 ) ... | Checks if the specified method matches against the method name expression . |
58,863 | public function getReferringRequest ( ) { if ( $ this -> referringRequest !== null ) { return $ this -> referringRequest ; } if ( ! isset ( $ this -> internalArguments [ '__referrer' ] ) ) { return null ; } if ( is_array ( $ this -> internalArguments [ '__referrer' ] ) ) { $ referrerArray = $ this -> internalArguments ... | Returns an ActionRequest which referred to this request if any . |
58,864 | public function setDispatched ( $ flag ) { $ this -> dispatched = $ flag ? true : false ; if ( $ flag ) { $ this -> emitRequestDispatched ( $ this ) ; } } | Sets the dispatched flag |
58,865 | public function getControllerObjectName ( ) { $ possibleObjectName = '@package\@subpackage\Controller\@controllerController' ; $ possibleObjectName = str_replace ( '@package' , str_replace ( '.' , '\\' , $ this -> controllerPackageKey ) , $ possibleObjectName ) ; $ possibleObjectName = str_replace ( '@subpackage' , $ t... | Returns the object name of the controller defined by the package key and controller name |
58,866 | public function setControllerObjectName ( $ unknownCasedControllerObjectName ) { $ controllerObjectName = $ this -> objectManager -> getCaseSensitiveObjectName ( $ unknownCasedControllerObjectName ) ; if ( $ controllerObjectName === false ) { throw new UnknownObjectException ( 'The object "' . $ unknownCasedControllerO... | Explicitly sets the object name of the controller |
58,867 | public function setControllerPackageKey ( $ packageKey ) { $ correctlyCasedPackageKey = $ this -> packageManager -> getCaseSensitivePackageKey ( $ packageKey ) ; $ this -> controllerPackageKey = ( $ correctlyCasedPackageKey !== false ) ? $ correctlyCasedPackageKey : $ packageKey ; } | Sets the package key of the controller . |
58,868 | public function getControllerSubpackageKey ( ) { $ controllerObjectName = $ this -> getControllerObjectName ( ) ; if ( $ this -> controllerSubpackageKey !== null && $ controllerObjectName !== '' ) { return substr ( $ controllerObjectName , strlen ( $ this -> controllerPackageKey ) + 1 , strlen ( $ this -> controllerSub... | Returns the subpackage key of the specified controller . If there is no subpackage key set the method returns NULL . |
58,869 | public function setControllerActionName ( $ actionName ) { if ( ! is_string ( $ actionName ) ) { throw new Exception \ InvalidActionNameException ( 'The action name must be a valid string, ' . gettype ( $ actionName ) . ' given (' . $ actionName . ').' , 1187176358 ) ; } if ( $ actionName === '' ) { throw new Exception... | Sets the name of the action contained in this request . |
58,870 | public function getControllerActionName ( ) { $ controllerObjectName = $ this -> getControllerObjectName ( ) ; if ( $ controllerObjectName !== '' && ( $ this -> controllerActionName === strtolower ( $ this -> controllerActionName ) ) ) { $ controllerClassName = $ this -> objectManager -> getClassNameByObjectName ( $ co... | Returns the name of the action the controller is supposed to execute . |
58,871 | public function setArguments ( array $ arguments ) { $ this -> arguments = [ ] ; foreach ( $ arguments as $ key => $ value ) { $ this -> setArgument ( $ key , $ value ) ; } } | Sets the specified arguments . |
58,872 | public function getInternalArgument ( $ argumentName ) { return ( isset ( $ this -> internalArguments [ $ argumentName ] ) ? $ this -> internalArguments [ $ argumentName ] : null ) ; } | Returns the value of the specified internal argument . |
58,873 | protected function emitRequestDispatched ( $ request ) { if ( $ this -> objectManager !== null ) { $ dispatcher = $ this -> objectManager -> get ( SignalSlotDispatcher :: class ) ; if ( $ dispatcher !== null ) { $ dispatcher -> dispatch ( ActionRequest :: class , 'requestDispatched' , [ $ request ] ) ; } } } | Emits a signal when a Request has been dispatched |
58,874 | public static function readDirectoryRecursively ( string $ path , string $ suffix = null , bool $ returnRealPath = false , bool $ returnDotFiles = false ) : array { return iterator_to_array ( self :: getRecursiveDirectoryGenerator ( $ path , $ suffix , $ returnRealPath , $ returnDotFiles ) ) ; } | Returns all filenames from the specified directory . Filters hidden files and directories . |
58,875 | public static function emptyDirectoryRecursively ( string $ path ) { if ( ! is_dir ( $ path ) ) { throw new FilesException ( '"' . $ path . '" is no directory.' , 1169047616 ) ; } if ( self :: is_link ( $ path ) ) { if ( self :: unlink ( $ path ) !== true ) { throw new FilesException ( 'Could not unlink symbolic link "... | Deletes all files directories and subdirectories from the specified directory . The passed directory itself won t be deleted though . |
58,876 | public static function removeEmptyDirectoriesOnPath ( string $ path , string $ basePath = null ) { if ( $ basePath !== null ) { $ basePath = rtrim ( $ basePath , '/' ) ; if ( strpos ( $ path , $ basePath ) !== 0 ) { throw new FilesException ( sprintf ( 'Could not remove empty directories on path because the given base ... | Removes all empty directories on the specified path . If a base path is given this function will not remove directories even if empty above and including that base path . |
58,877 | public static function getFileContents ( string $ pathAndFilename , int $ flags = 0 , $ context = null , int $ offset = null , int $ maximumLength = - 1 ) { if ( $ flags === true ) { $ flags = FILE_USE_INCLUDE_PATH ; } try { if ( $ maximumLength > - 1 ) { $ content = file_get_contents ( $ pathAndFilename , $ flags , $ ... | An enhanced version of file_get_contents which intercepts the warning issued by the original function if a file could not be loaded . |
58,878 | public static function getUploadErrorMessage ( int $ errorCode ) : string { switch ( $ errorCode ) { case \ UPLOAD_ERR_INI_SIZE : return 'The uploaded file exceeds the upload_max_filesize directive in php.ini' ; case \ UPLOAD_ERR_FORM_SIZE : return 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specifi... | Returns a human - readable message for the given PHP file upload error constant . |
58,879 | public static function bytesToSizeString ( $ bytes , int $ decimals = null , string $ decimalSeparator = null , string $ thousandsSeparator = null ) : string { if ( ! is_int ( $ bytes ) && ! is_float ( $ bytes ) ) { if ( is_numeric ( $ bytes ) ) { $ bytes = ( float ) $ bytes ; } else { $ bytes = 0 ; } } if ( $ decimals... | Converts an integer with a byte count into human - readable form |
58,880 | public static function getRelativePath ( string $ from , string $ to ) : string { $ from = self :: getUnixStylePath ( $ from ) ; $ to = self :: getUnixStylePath ( $ to ) ; if ( is_dir ( $ from ) ) { $ from = self :: getNormalizedPath ( $ from ) ; } if ( is_dir ( $ to ) ) { $ to = self :: getNormalizedPath ( $ to ) ; } ... | Finds the relative path between two given absolute paths . Credits go to stackoverflow member Gordon . |
58,881 | public function injectDataMapper ( DataMapper $ dataMapper ) { $ this -> dataMapper = $ dataMapper ; $ this -> dataMapper -> setPersistenceManager ( $ this ) ; } | Injects the data mapper |
58,882 | public function initializeObject ( ) { if ( ! $ this -> backend instanceof Backend \ BackendInterface ) { throw new MissingBackendException ( 'A persistence backend must be set prior to initializing the persistence manager.' , 1215508456 ) ; } $ this -> backend -> setPersistenceManager ( $ this ) ; $ this -> backend ->... | Initializes the persistence manager |
58,883 | public function clearState ( ) { parent :: clearState ( ) ; $ this -> addedObjects = new \ SplObjectStorage ( ) ; $ this -> removedObjects = new \ SplObjectStorage ( ) ; $ this -> changedObjects = new \ SplObjectStorage ( ) ; $ this -> persistenceSession -> destroy ( ) ; $ this -> hasUnpersistedChanges = false ; } | Clears the in - memory state of the persistence . |
58,884 | public function flush ( ) { $ script = " local entries = redis.call('LRANGE',KEYS[1],0,-1) for k1,entryIdentifier in ipairs(entries) do redis.call('DEL', ARGV[1]..'entry:'..entryIdentifier) local tags = redis.call('SMEMBERS', ARGV[1]..'tags:'..entryIdentifier) for k2,tagName in ipairs(tags) do redis.call('DE... | Removes all cache entries of this cache |
58,885 | public function isFrozen ( ) : bool { if ( null === $ this -> frozen ) { $ this -> frozen = $ this -> redis -> exists ( $ this -> buildKey ( 'frozen' ) ) ; } return $ this -> frozen ; } | Tells if this backend is frozen . |
58,886 | public function getStatus ( ) : Result { $ result = new Result ( ) ; try { $ this -> verifyRedisVersionIsSupported ( ) ; } catch ( CacheException $ exception ) { $ result -> addError ( new Error ( $ exception -> getMessage ( ) , $ exception -> getCode ( ) , [ ] , 'Redis Version' ) ) ; return $ result ; } $ serverInfo =... | Validates that the configured redis backend is accessible and returns some details about its configuration if that s the case |
58,887 | public function generateActionController ( $ packageKey , $ subpackage , $ controllerName , $ overwrite = false ) { list ( $ baseNamespace , $ namespaceEntryPath ) = $ this -> getPrimaryNamespaceAndEntryPath ( $ this -> packageManager -> getPackage ( $ packageKey ) ) ; $ controllerName = ucfirst ( $ controllerName ) ; ... | Generate a controller with the given name for the given package |
58,888 | public function generateView ( $ packageKey , $ subpackage , $ controllerName , $ viewName , $ templateName , $ overwrite = false ) { list ( $ baseNamespace ) = $ this -> getPrimaryNamespaceAndEntryPath ( $ this -> packageManager -> getPackage ( $ packageKey ) ) ; $ viewName = ucfirst ( $ viewName ) ; $ templatePathAnd... | Generate a view with the given name for the given package and controller |
58,889 | public function generateLayout ( $ packageKey , $ layoutName , $ overwrite = false ) { $ layoutName = ucfirst ( $ layoutName ) ; $ templatePathAndFilename = 'resource://Neos.Kickstarter/Private/Generator/View/' . $ layoutName . 'Layout.html' ; $ contextVariables = [ ] ; $ contextVariables [ 'packageKey' ] = $ packageKe... | Generate a default layout |
58,890 | public function generateModel ( $ packageKey , $ modelName , array $ fieldDefinitions , $ overwrite = false ) { list ( $ baseNamespace , $ namespaceEntryPath ) = $ this -> getPrimaryNamespaceAndEntryPath ( $ this -> packageManager -> getPackage ( $ packageKey ) ) ; $ modelName = ucfirst ( $ modelName ) ; $ namespace = ... | Generate a model for the package with the given model name and fields |
58,891 | public function generateRepository ( $ packageKey , $ modelName , $ overwrite = false ) { list ( $ baseNamespace , $ namespaceEntryPath ) = $ this -> getPrimaryNamespaceAndEntryPath ( $ this -> packageManager -> getPackage ( $ packageKey ) ) ; $ modelName = ucfirst ( $ modelName ) ; $ repositoryClassName = $ modelName ... | Generate a repository for a model given a model name and package key |
58,892 | public function generateDocumentation ( $ packageKey ) { $ documentationPath = Files :: concatenatePaths ( [ $ this -> packageManager -> getPackage ( $ packageKey ) -> getPackagePath ( ) , 'Documentation' ] ) ; $ contextVariables = [ ] ; $ contextVariables [ 'packageKey' ] = $ packageKey ; $ templatePathAndFilename = '... | Generate a documentation skeleton for the package key |
58,893 | public function generateTranslation ( $ packageKey , $ sourceLanguageKey , array $ targetLanguageKeys = [ ] ) { $ translationPath = 'resource://' . $ packageKey . '/Private/Translations' ; $ contextVariables = [ ] ; $ contextVariables [ 'packageKey' ] = $ packageKey ; $ contextVariables [ 'sourceLanguageKey' ] = $ sour... | Generate translation for the package key |
58,894 | protected function normalizeFieldDefinitions ( array $ fieldDefinitions , $ namespace = '' ) { foreach ( $ fieldDefinitions as & $ fieldDefinition ) { if ( $ fieldDefinition [ 'type' ] == 'bool' ) { $ fieldDefinition [ 'type' ] = 'boolean' ; } elseif ( $ fieldDefinition [ 'type' ] == 'int' ) { $ fieldDefinition [ 'type... | Normalize types and prefix types with namespaces |
58,895 | protected function generateFile ( $ targetPathAndFilename , $ fileContent , $ force = false ) { if ( ! is_dir ( dirname ( $ targetPathAndFilename ) ) ) { \ Neos \ Utility \ Files :: createDirectoryRecursively ( dirname ( $ targetPathAndFilename ) ) ; } if ( substr ( $ targetPathAndFilename , 0 , 11 ) === 'resource://' ... | Generate a file with the given content and add it to the generated files |
58,896 | protected function renderTemplate ( $ templatePathAndFilename , array $ contextVariables ) { $ standaloneView = new StandaloneView ( ) ; $ standaloneView -> setTemplatePathAndFilename ( $ templatePathAndFilename ) ; $ standaloneView -> assignMultiple ( $ contextVariables ) ; return $ standaloneView -> render ( ) ; } | Render the given template file with the given variables |
58,897 | public function resolveOperation ( $ operationName , $ context ) { if ( ! isset ( $ this -> operations [ $ operationName ] ) ) { throw new FlowQueryException ( 'Operation "' . $ operationName . '" not found.' , 1332491837 ) ; } foreach ( $ this -> operations [ $ operationName ] as $ operationClassName ) { $ operation =... | Resolve an operation taking runtime constraints into account . |
58,898 | public function initialize ( JoinPointInterface $ joinPoint ) { $ proxy = $ joinPoint -> getProxy ( ) ; if ( property_exists ( $ proxy , 'Flow_Persistence_LazyLoadingObject_thawProperties' ) && $ proxy -> Flow_Persistence_LazyLoadingObject_thawProperties instanceof \ Closure ) { $ proxy -> Flow_Persistence_LazyLoadingO... | Before advice making sure we initialize before use . |
58,899 | protected function parseDesignatorPointcut ( string $ operator , string $ pointcutExpression , PointcutFilterComposite $ pointcutFilterComposite , array & $ trace = [ ] ) : void { throw new InvalidPointcutExpressionException ( 'The given method privilege target matcher contained an expression for a named pointcut. This... | Throws an exception as recursive privilege targets are not allowed . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.