idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
238,300 | public function parseInto ( Query $ query , $ str , $ urlEncoding = true ) { if ( $ str === '' ) { return ; } $ result = [ ] ; $ this -> duplicates = false ; $ this -> numericIndices = true ; $ decoder = self :: getDecoder ( $ urlEncoding ) ; foreach ( explode ( '&' , $ str ) as $ kvp ) { $ parts = explode ( '=' , $ kv... | Parse a query string into a Query object . |
238,301 | private static function getDecoder ( $ type ) { if ( $ type === true ) { return function ( $ value ) { return rawurldecode ( str_replace ( '+' , ' ' , $ value ) ) ; } ; } elseif ( $ type == Query :: RFC3986 ) { return 'rawurldecode' ; } elseif ( $ type == Query :: RFC1738 ) { return 'urldecode' ; } else { return functi... | Returns a callable that is used to URL decode query keys and values . |
238,302 | private function parsePhpValue ( $ key , $ value , array & $ result ) { $ node = & $ result ; $ keyBuffer = '' ; for ( $ i = 0 , $ t = strlen ( $ key ) ; $ i < $ t ; $ i ++ ) { switch ( $ key [ $ i ] ) { case '[' : if ( $ keyBuffer ) { $ this -> prepareNode ( $ node , $ keyBuffer ) ; $ node = & $ node [ $ keyBuffer ] ;... | Parses a PHP style key value pair . |
238,303 | private function prepareNode ( & $ node , $ key ) { if ( ! isset ( $ node [ $ key ] ) ) { $ node [ $ key ] = null ; } elseif ( ! is_array ( $ node [ $ key ] ) ) { $ node [ $ key ] = [ $ node [ $ key ] ] ; } } | Prepares a value in the array at the given key . |
238,304 | private function cleanKey ( $ node , $ key ) { if ( $ key === '' ) { $ key = $ node ? ( string ) count ( $ node ) : 0 ; $ this -> numericIndices = false ; } return $ key ; } | Returns the appropriate key based on the node and key . |
238,305 | public function append ( NodeDefinition $ node ) { if ( $ node instanceof ParentNodeDefinitionInterface ) { $ builder = clone $ this ; $ builder -> setParent ( null ) ; $ node -> setBuilder ( $ builder ) ; } if ( null !== $ this -> parent ) { $ this -> parent -> append ( $ node ) ; $ node -> setParent ( $ this ) ; } re... | Appends a node definition . |
238,306 | protected function getRefillAttr ( $ field , ItemEntity $ item = null ) { if ( $ item instanceof ItemEntity && $ item -> getName ( ) && ( $ plugins = $ this -> chain -> getPluginsThatCanFillItem ( $ item , $ field ) ) ) { foreach ( $ plugins as $ key => $ plugin ) { $ plugins [ $ key ] = [ 'name' => $ plugin -> getName... | Get the field refill attributes . |
238,307 | public function isValid ( $ value ) { if ( version_compare ( VersionNumberUtility :: getCurrentTypo3Version ( ) , '7.6.0' , '<' ) ) { throw new UnsupportedVersionException ( 'The validator "' . self :: class . '" cannot be used in TYPO3 versions anterior to `7.6.0`.' , 1506281412 ) ; } $ value = ( string ) $ value ; if... | Checks that the given icon identifier exists in the TYPO3 icon registry . |
238,308 | private function findMedia ( $ path ) { $ media = $ this -> get ( 'ekyna_media.media.repository' ) -> findOneBy ( [ 'path' => $ path ] ) ; if ( null === $ media ) { throw new NotFoundHttpException ( 'Media not found' ) ; } $ fs = $ this -> get ( 'local_media_filesystem' ) ; if ( ! $ fs -> has ( $ media -> getPath ( ) )... | Finds the media by his path . |
238,309 | public function boot ( \ TYPO3 \ Flow \ Core \ Bootstrap $ bootstrap ) { $ dispatcher = $ bootstrap -> getSignalSlotDispatcher ( ) ; $ dispatcher -> connect ( 'Lightwerk\SurfCaptain\GitApi\ApiRequest' , 'apiCall' , 'Lightwerk\SurfCaptain\GitApi\RequestListener' , 'saveApiCall' ) ; $ dispatcher -> connect ( 'Lightwerk\S... | Boot the package . We wire some signals to slots here . |
238,310 | private function getPsrRequest ( Request $ symfonyRequest ) : ServerRequestInterface { $ psrRequest = $ this -> diactorosFactory -> createRequest ( $ symfonyRequest ) ; $ psrRequest = $ psrRequest -> withAttribute ( 'request' , $ symfonyRequest ) ; return $ psrRequest ; } | To transform a symfony request as a psr request and inject the symfony request as attribute if the endpoint need the symfony request . |
238,311 | public function deploy ( ) { if ( empty ( $ this -> context ) || empty ( $ this -> siteDomain ) || empty ( $ this -> deviceView ) || empty ( $ this -> design ) ) return ; $ files = null ; $ md5 = null ; $ contents = null ; $ aggregatePath = $ this -> getAggregatePath ( ) ; $ this -> Logger -> debug ( "Aggregate Path: {... | Aggregates the files if necessary . |
238,312 | public function resolveFile ( $ name ) { $ resolvedFilename = $ this -> getBaseDeployDirectory ( ) . $ this -> subject . '/' . ltrim ( $ name , '/' ) ; return new StorageFacilityFile ( '/' . ltrim ( $ name , '/' ) , $ resolvedFilename ) ; } | Returns the full filename of an existing deployed file with the name specified . |
238,313 | protected function getFiles ( ) { if ( $ this -> isSiteDeployment ) { if ( $ this -> deviceView != 'main' && ! is_dir ( "{$this->viewDirectory}/{$this->context}/{$this->siteDomain}/{$this->deviceView}" ) ) { $ this -> deviceView = 'main' ; } if ( $ this -> design != 'default' && ! is_dir ( "{$this->viewDirectory}/{$thi... | Returns a list of all the files in the theme directory combined with all the asset files of all installed plugins |
238,314 | public static function fromQName ( $ name ) { if ( $ name instanceof QName ) { $ name = "{$name->prefix}:{$name->localName}" ; } if ( ! is_string ( $ name ) ) { throw new \ InvalidArgumentException ( "$name must be string or a QName instanxe" ) ; } $ types = SchemaTypes :: getInstance ( ) ; $ attribute = $ types -> get... | The qualified name of the attribute |
238,315 | protected static function setURI ( $ uri ) { if ( ! is_string ( $ uri ) ) { throw new InvalidArgumentException ( '$uri must be a string or null' ) ; } self :: $ uri = filter_var ( $ uri , FILTER_SANITIZE_URL ) ; } | Sets the link URI |
238,316 | protected static function setAnchorPoint ( $ anchor ) { if ( is_string ( $ anchor ) && ! empty ( trim ( $ anchor ) ) ) { self :: $ anchor = '#' . trim ( $ anchor , '#' ) ; } else { self :: $ anchor = false ; } } | Sets the anchor point for the link |
238,317 | public static function getHref ( $ link ) { self :: setURI ( $ link [ 'uri' ] ) ; self :: setAnchorPoint ( $ link [ 'fragment' ] ) ; return self :: getURI ( ) . self :: getAnchorPoint ( ) ; } | Returns the correctly formatted link string |
238,318 | protected function extractGeneric ( $ type ) { if ( empty ( $ type ) ) { return null ; } $ generic = null ; if ( substr ( $ type , - 2 ) === '[]' ) { $ generic = substr ( $ type , 0 , - 2 ) ; } elseif ( strtolower ( substr ( $ type , 0 , 6 ) ) === 'array<' && substr ( $ type , - 1 ) === '>' ) { $ generic = substr ( $ t... | Extract the generic subtype from the specified type if there is one . |
238,319 | public function setClass ( $ clazz ) { if ( $ clazz instanceof ClassMetadata ) { $ classMetadata = $ clazz ; $ classname = $ clazz -> getReflectionClass ( ) -> getName ( ) ; } else if ( class_exists ( $ clazz ) ) { $ classname = $ clazz ; $ classMetadata = $ this -> getEntityManager ( ) -> getClassMetadata ( $ clazz ) ... | Sets the class associated with this configuration |
238,320 | public function setBaseQueryBuilder ( QueryBuilder $ baseQueryBuilder = null ) { if ( $ baseQueryBuilder === null ) { $ this -> baseQueryBuilder = $ this -> getDefaultQueryBuilder ( ) ; } else { $ this -> baseQueryBuilder = $ baseQueryBuilder ; } } | sets the base query builder |
238,321 | public function getDefaultQueryBuilder ( ) { $ em = $ this -> getEntityManager ( ) ; return $ em -> createQueryBuilder ( ) -> select ( 'n' ) -> from ( $ this -> getClassname ( ) , 'n' ) ; } | gets the default query builder |
238,322 | protected function addToDocument ( $ document ) { parent :: addToDocument ( $ document ) ; $ this -> getRangeKey ( ) -> getPropertyMetadata ( ) -> setValue ( $ document , $ this -> getRangeValue ( ) ) ; } | Set this identifier s values on the provided document instance . |
238,323 | protected function getArray ( ) { $ key = $ this -> getRangeKey ( ) -> getPropertyMetadata ( ) -> name ; $ array = parent :: getArray ( ) ; $ array [ $ key ] = $ this -> getRangeValue ( ) ; return $ array ; } | Return this identifier s key names and values . |
238,324 | public function push ( string $ key , $ value ) : self { $ this -> offsetSet ( $ key , $ value ) ; return $ this ; } | Push a configuration in via the key |
238,325 | public function remove ( ... $ with_keys ) : self { foreach ( $ with_keys as $ keys ) { foreach ( ( array ) $ keys as $ k ) { $ this -> offsetUnset ( $ k ) ; } } return $ this ; } | Removes an item or multiple items . |
238,326 | public function unsetFilter ( $ array , $ keys ) { if ( is_array ( $ array ) ) { if ( ! is_array ( $ keys ) ) { $ keys = array ( $ keys ) ; } foreach ( $ keys as $ key ) { if ( array_key_exists ( $ key , $ array ) ) { unset ( $ array [ $ key ] ) ; } } } return $ array ; } | Removes an element from the given array |
238,327 | public function getRewritedParameters ( $ parameter ) { if ( is_int ( $ parameter ) ) { return array ( $ parameter ) ; } if ( ! isset ( $ this -> parameters [ $ parameter ] ) ) { throw StatementRewriterException :: parameterDoesNotExist ( $ parameter ) ; } return $ this -> parameters [ $ parameter ] ; } | Gets the rewrited positional statement parameters according to the named parameter . |
238,328 | private function rewrite ( ) { $ positionalParameter = 1 ; $ literal = false ; $ statementLength = strlen ( $ this -> statement ) ; for ( $ placeholderPos = 0 ; $ placeholderPos < $ statementLength ; $ placeholderPos ++ ) { if ( in_array ( $ this -> statement [ $ placeholderPos ] , array ( '\'' , '"' ) ) ) { $ literal ... | Rewrite the named statement and parameters to positional . |
238,329 | private function isValidPlaceholderCharacter ( $ character ) { $ asciiCode = ord ( $ character ) ; return ( ( $ asciiCode >= 48 ) && ( $ asciiCode <= 57 ) ) || ( ( $ asciiCode >= 65 ) && ( $ asciiCode <= 90 ) ) || ( ( $ asciiCode >= 97 ) && ( $ asciiCode <= 122 ) ) ; } | Checks if the character is a valid placeholder character . |
238,330 | public function deepMerge ( array $ mergee , array $ merger ) { $ merged = $ mergee ; foreach ( $ merger as $ key => & $ value ) { if ( array_key_exists ( $ key , $ merged ) && is_array ( $ value ) && is_array ( $ merged [ $ key ] ) ) { $ merged [ $ key ] = $ this -> deepMerge ( $ merged [ $ key ] , $ value ) ; } else ... | Performs an array merge but when both values for a key are arrays a deep merge will occur retaining the unique keys of both without changing the value types . |
238,331 | protected function changeOptions ( $ category ) { $ thumbnails = $ category -> ancestorsAndSelf ( ) -> with ( 'thumbnails' ) -> get ( ) -> map ( function ( $ item ) { return $ item -> thumbnails -> keyBy ( 'slug' ) -> map ( function ( $ item ) { return [ 'width' => $ item -> photo_width , 'height' => $ item -> photo_he... | change options with model category |
238,332 | public static function saveFile ( $ file , string $ uploadsFolderPath ) { if ( ! empty ( $ file ) && is_array ( $ file ) && ! empty ( $ uploadsFolderPath ) ) { $ fileName = $ file [ 'name' ] ; $ temporaryFileName = $ file [ 'tmp_name' ] ; if ( GeneralUtility :: verifyFilenameAgainstDenyPattern ( $ fileName ) ) { $ uplo... | Saves a file to an uploads folder . |
238,333 | public static function cleanFileName ( string $ fileName , array $ rulesets = self :: FILE_NAME_RULESETS , string $ separator = '-' ) : string { $ slugify = new Slugify ( [ 'rulesets' => $ rulesets , 'separator' => $ separator ] ) ; $ name = $ slugify -> slugify ( pathinfo ( $ fileName , PATHINFO_FILENAME ) ) ; $ exten... | Cleans a file name . |
238,334 | public static function normalizeFileName ( string $ fileName , array $ rulesets = self :: FILE_NAME_RULESETS , string $ separator = '-' ) : string { return self :: cleanFileName ( $ fileName , $ rulesets , $ separator ) ; } | Normalizes a file name alias for cleanFileName . |
238,335 | public static function getUniqueFileName ( string $ fileName , string $ directory ) : string { $ basicFileUtility = GeneralUtility :: makeInstance ( BasicFileUtility :: class ) ; return $ basicFileUtility -> getUniqueName ( $ fileName , $ directory ) ; } | Gets an unique file name . |
238,336 | public function addGenus ( \ Librinfo \ VarietiesBundle \ Entity \ Genus $ genus ) { $ genus -> setFamily ( $ this ) ; $ this -> genuses -> add ( $ genus ) ; return $ this ; } | Add genus . |
238,337 | public function removeGenus ( \ Librinfo \ VarietiesBundle \ Entity \ Genus $ genus ) { return $ this -> genuses -> removeElement ( $ genus ) ; } | Remove genus . |
238,338 | protected function execute ( InputInterface $ input , OutputInterface $ output ) { $ logger = $ this -> getContainer ( ) -> get ( 'ringo_php_redmon.instance_logger' ) ; $ manager = $ this -> getContainer ( ) -> get ( 'ringo_php_redmon.instance_manager' ) ; $ instances = $ manager -> findAll ( ) ; if ( is_array ( $ inst... | Execute task Get all redis instances and log some of infos |
238,339 | public static function createWorkingDirectory ( ) { $ workdir = sys_get_temp_dir ( ) . '/tmp-' . session_id ( ) . '/' ; self :: recursiveMkdir ( $ workdir , 0777 ) ; if ( ! is_dir ( $ workdir ) ) { throw new Exception ( "cannot create directory: " . $ workdir ) ; } return $ workdir ; } | Creates a unique temporary directory and returns the absolute path |
238,340 | public static function recursiveRmdir ( $ path , $ removeParent = true ) { if ( ! file_exists ( $ path ) ) return true ; if ( ! is_dir ( $ path ) ) return @ unlink ( $ path ) ; $ objects = new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ path ) , RecursiveIteratorIterator :: CHILD_FIRST ) ; foreach ( ... | Recursively remove a directory and its contents . |
238,341 | public static function secureTmpname ( $ dir = null , $ prefix = 'tmp' , $ postfix = '.tmp' ) { if ( ! ( isset ( $ postfix ) && is_string ( $ postfix ) ) ) return false ; if ( ! ( isset ( $ prefix ) && is_string ( $ prefix ) ) ) return false ; if ( ! isset ( $ dir ) ) $ dir = getcwd ( ) ; $ tries = 1 ; do { $ sysFileNa... | Creates a temp file with a specific extension . |
238,342 | public function registerStream ( StreamInterface $ stream , $ replaceWrapper = false ) { $ protocol = $ stream -> getProtocol ( ) ; if ( $ replaceWrapper === true && in_array ( $ protocol , stream_get_wrappers ( ) ) ) { stream_wrapper_unregister ( $ protocol ) ; } if ( stream_wrapper_register ( $ protocol , $ stream ->... | Registers stream instance for a protocol . |
238,343 | public function unregisterStream ( $ protocol ) { if ( isset ( self :: $ streams [ $ protocol ] ) ) { $ result = stream_wrapper_unregister ( $ protocol ) ; if ( $ result === true ) { unset ( self :: $ streams [ $ protocol ] ) ; } } return $ this ; } | Unregisters a stream instance by protocol . |
238,344 | public static function ImageOverlayLinkBegin ( $ dummy , \ Title $ target , & $ text , & $ customAttribs , & $ query , & $ options , & $ ret ) { global $ wgDIQAImageOverlayWhitelist ; global $ wgDIQADownloadWhitelist ; if ( ! self :: isImage ( $ target -> mNamespace ) ) { return true ; } $ file = wfFindFile ( $ target ... | Rewrites links to images in order to open them into a overlay |
238,345 | public function generateCommandProxy ( $ className ) { $ classMeta = $ this -> reflectionService -> getClassMetaReflection ( $ className ) ; $ proxies = [ ] ; $ cachePath = $ this -> getRaptorCachePath ( ) ; $ this -> createDirectory ( $ cachePath ) ; $ thisNode = new Variable ( 'this' ) ; foreach ( $ classMeta -> getM... | Entry point to create proxies of a bonefish command class |
238,346 | protected function getCommandName ( $ methodMeta , $ classMeta ) { $ nameSpaceParts = explode ( '\\' , $ classMeta -> getNamespace ( ) ) ; $ vendor = $ nameSpaceParts [ 0 ] ; $ package = $ nameSpaceParts [ 1 ] ; return strtolower ( $ vendor . ':' . $ package . ':' . str_replace ( self :: COMMAND_SUFFIX , '' , $ methodM... | Create a unique command name |
238,347 | public function next ( ) { $ this -> _itemValid = true ; if ( ! prev ( $ this -> _items ) ) { $ this -> _itemValid = false ; } else { $ this -> _itemPosition -- ; } } | set next item to current item |
238,348 | private function fetchAccessToken ( ) { $ params = [ 'client_id' => $ this -> clientID , 'client_secret' => $ this -> secret , 'grant_type' => 'authorization_code' , 'code' => $ this -> requestToken ] ; if ( isset ( $ this -> redirectURI ) ) { $ params [ 'redirect_uri' ] = $ this -> redirectURI ; } $ this -> parseAcces... | Does a cURL to request a new access token |
238,349 | private function refreshAccessToken ( ) { $ params = [ 'client_id' => $ this -> clientID , 'client_secret' => $ this -> secret , 'grant_type' => 'refresh_token' , 'refresh_token' => $ this -> refreshToken ] ; $ this -> parseAccessToken ( CURL :: post ( $ this -> url , $ params ) ) ; } | Refreshes the access token |
238,350 | public function processRequestToken ( $ token ) { $ params = [ 'client_id' => $ this -> clientID , 'client_secret' => $ this -> secret , 'code' => $ token , 'grant_type' => 'authorization_code' , 'redirect_uri' => $ this -> redirectURI ] ; return CURL :: post ( $ this -> url , $ params ) ; } | Convert a request token to an access token |
238,351 | public function setCallbacks ( array $ callbacks ) { foreach ( $ callbacks as $ attribute => $ callback ) { if ( ! is_callable ( $ callback ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The given callback for attribute "%s" is not callable.' , $ attribute ) ) ; } } $ this -> callbacks = $ callbacks ; } | Set normalization callbacks |
238,352 | protected function formatAttribute ( $ attributeName ) { if ( in_array ( $ attributeName , $ this -> camelizedAttributes ) ) { return preg_replace_callback ( '/(^|_|\.)+(.)/' , function ( $ match ) { return ( '.' === $ match [ 1 ] ? '_' : '' ) . strtoupper ( $ match [ 2 ] ) ; } , $ attributeName ) ; } return $ attribut... | Format attribute name to access parameters or methods As option if attribute name is found on camelizedAttributes array returns attribute name in camelcase format |
238,353 | public function getServerVersion ( ) { $ di = new DBInstance ( $ this -> rawConfig ) ; $ version = $ di -> getServerVersion ( ) ; unset ( $ di ) ; return array ( 'version' => $ version , ) ; } | Get DBInstance database version . |
238,354 | public function message ( $ type , $ message ) { if ( $ this -> session -> has ( 'flashMessages' ) ) { $ flashMessages = $ this -> session -> get ( 'flashMessages' ) ; $ flashMessages [ ] = [ 'type' => $ type , 'message' => $ message ] ; $ this -> session -> set ( 'flashMessages' , $ flashMessages ) ; } else { $ this -... | Saves the message in the session . |
238,355 | public function output ( ) { if ( $ this -> session -> has ( 'flashMessages' ) ) { $ flashMessages = $ this -> session -> get ( 'flashMessages' ) ; $ this -> session -> set ( 'flashMessages' , [ ] ) ; $ html = null ; foreach ( $ flashMessages as $ message ) { $ html .= "<div class='" . $ message [ 'type' ] . "'>" . $ m... | Gets and resets the flash messages from session and building html . |
238,356 | public function elapsedTime ( ) { $ currentTime = microtime ( true ) ; if ( $ this -> startTime === null ) { $ this -> startTime = $ currentTime ; $ this -> finishTime = $ currentTime ; } else { $ this -> finishTime = $ currentTime ; $ this -> elapsedTimeFromStart = $ currentTime - $ this -> startTime ; } } | Calculated the different time of the log line . |
238,357 | public function store ( $ id , $ data , $ maxLifetimeSeconds = null ) { $ creationTimestamp = time ( ) ; if ( null === $ maxLifetimeSeconds ) { $ expirationTimestamp = null ; } else { $ expirationTimestamp = ( $ creationTimestamp + ( int ) $ maxLifetimeSeconds ) ; } $ entry = new CacheEntry ( $ id , $ data , $ creation... | Attempts to store provided content into cache . Cache file will hold creation and expiration timestamps and provided content . |
238,358 | public function tryFetch ( $ id , $ maxLifetimeSeconds = null ) { $ entry = $ this -> storage -> tryFetch ( $ id ) ; if ( null === $ entry ) { return null ; } if ( null !== $ maxLifetimeSeconds ) { if ( ( $ this -> nowTimestamp - $ entry -> creationTimestamp ( ) ) > $ maxLifetimeSeconds ) { return null ; } } if ( null ... | Attempts to retrieve data from cache . |
238,359 | public function getDependsInfo ( ) { $ dependsInfo = $ this -> getCachedValue ( 'dependsInfo' ) ; if ( $ dependsInfo === false ) { $ data = $ this -> dataProvider -> getData ( ) ; $ dependsInfo = array ( ) ; foreach ( $ this -> getPackageSortOrder ( ) as $ packageId => $ order ) { if ( ! isset ( $ data [ $ packageId ] ... | Gets a flat list of file dependencies for each file |
238,360 | static function instance ( $ syspath , $ conf ) { $ i = new static ; $ i -> env = $ i -> environementInstance ( $ syspath , $ conf ) ; return $ i ; } | You may set debugMode to true to use debug modules otherwise if modules with a debug type in the autoload rules section are found they will be ignored . |
238,361 | function exists ( $ symbol , $ autoload = false ) { return class_exists ( $ symbol , $ autoload ) || interface_exists ( $ symbol , $ autoload ) || trait_exists ( $ symbol , $ autoload ) ; } | Maintained for backwards comaptibility . |
238,362 | function load ( $ symbol ) { if ( $ this -> env -> knownUnknown ( $ symbol ) ) { return false ; } if ( $ this -> env -> autoresolve ( $ symbol ) ) { return true ; } $ ns_pos = \ strripos ( $ symbol , '\\' ) ; if ( $ ns_pos !== false && $ ns_pos != 0 ) { $ ns = \ substr ( $ symbol , 0 , $ ns_pos + 1 ) ; $ mainsegment = ... | Load given symbol |
238,363 | public function setExpireDate ( DateTimeInterface $ dt ) { $ this -> expire_time = ( int ) $ dt -> format ( 'U' ) - time ( ) ; return $ this ; } | Set the exact moment when the cache should expire . |
238,364 | public function setExpiresIn ( DateInterval $ interval ) { $ now = new DateTimeImmutable ( ) ; $ expire = $ now -> add ( $ interval ) ; $ this -> setExpiresInSeconds ( $ expire -> getTimestamp ( ) - $ now -> getTimestamp ( ) ) ; return $ this ; } | Set the time until the cache should expire . |
238,365 | public function setExpires ( $ period ) { if ( is_int ( $ period ) ) return $ this -> setExpiresInSeconds ( $ period ) ; if ( $ period instanceof DateTimeInterface ) return $ this -> setExpireDate ( $ period ) ; if ( $ period instanceof DateInterval ) return $ this -> setExpiresIn ( $ period ) ; throw new \ InvalidArgu... | Set the when the cache should expire . Wrapper for setExpiresIn setExpiresInSeconds and setExpireDate with type detection . |
238,366 | public function setCachePolicy ( string $ policy ) { if ( $ policy !== self :: CACHE_DISABLE && $ policy !== self :: CACHE_PUBLIC && $ policy !== self :: CACHE_PRIVATE ) throw new \ InvalidArgumentException ( "Invalid cache policy: " . $ policy ) ; $ this -> cache_policy = $ policy ; return $ this ; } | Set the cache policy for this response . |
238,367 | public function setAttribute ( $ attr , $ value ) { $ attr = strtolower ( $ attr ) ; if ( is_null ( $ value ) ) { unset ( $ this -> attributes [ $ attr ] ) ; } else { $ this -> attributes [ $ attr ] = $ value ; } return $ this ; } | sets attributes of form label |
238,368 | public function render ( ) { $ attr = [ ] ; foreach ( $ this -> attributes as $ k => $ v ) { $ attr [ ] = sprintf ( '%s="%s"' , $ k , $ v ) ; } return sprintf ( '<label %s>%s</label>' , implode ( ' ' , $ attr ) , trim ( $ this -> labelText ) ) ; } | render the label element if a form element was assigned a matching for attribute can be generated |
238,369 | public function translit ( $ string ) { $ string = \ strtr ( $ string , $ this -> transliterationTable ) ; return \ iconv ( \ mb_internal_encoding ( ) , 'ASCII//TRANSLIT' , $ string ) ; } | transliteration cyr - > lat |
238,370 | public function end ( $ name , $ append = true ) { $ content = trim ( ob_get_contents ( ) ) ; ob_end_clean ( ) ; $ hash = md5 ( $ content ) ; if ( isset ( $ this -> hashCache [ $ hash ] ) ) { return ; } $ this -> hashCache [ $ hash ] = true ; if ( isset ( $ this -> blocks [ $ name ] ) && $ append ) { $ this -> blocks [... | End to catch block and save it . |
238,371 | public function beforeDispatch ( \ Magento \ Framework \ App \ FrontControllerInterface $ subject , \ Magento \ Framework \ App \ RequestInterface $ request ) { $ code = $ request -> getParam ( static :: REQ_REFERRAL ) ; if ( ! empty ( $ code ) ) { $ this -> session -> logout ( ) ; } $ this -> hlpRefCode -> processHttp... | Extract referral code from GET - variable or cookie and save it into registry . |
238,372 | static function fuse ( & $ opt1 , $ opt2 ) { return isset ( $ opt1 ) ? $ opt1 : ( isset ( $ opt2 ) ? $ opt2 : null ) ; } | Alternate a value to undefined variable |
238,373 | public function includeFile ( $ templateFilename ) { $ tpl = $ this ; eval ( '?>' . file_get_contents ( Application :: getInstance ( ) -> getRootPath ( ) . ( defined ( 'TPL_PATH' ) ? str_replace ( '/' , DIRECTORY_SEPARATOR , ltrim ( TPL_PATH , '/' ) ) : '' ) . $ templateFilename ) ) ; } | include another template file does only path handling included files are within the same scope as the including file |
238,374 | public function createFile ( $ perm ) { if ( $ this -> isFile ( ) ) return false ; IoUtils :: touch ( $ this -> path ) ; IoUtils :: chmod ( $ this -> path , $ perm ) ; return true ; } | Atomically creates a new empty file named by this abstract path if and only if a file with this name does not yet exist . |
238,375 | public function tpl ( string $ tpl , ? array $ params = [ ] , ? string $ dir = null ) { try { $ this -> message = App :: $ View -> render ( $ tpl , $ params , $ dir ) ; } catch ( SyntaxException $ e ) { } return $ this ; } | Set tpl file |
238,376 | public function send ( string $ address , string $ subject , ? string $ message = null ) : bool { if ( $ message === null ) { $ message = $ this -> message ; } try { if ( $ message === null ) { throw new \ Exception ( 'Message body is empty!' ) ; } $ message = ( new \ Swift_Message ( $ subject ) ) -> setFrom ( $ this -... | Set mail to address |
238,377 | protected function Init ( ) { $ this -> layout = new Layout ( Request :: GetData ( 'layout' ) ) ; $ this -> layoutRights = new LayoutRights ( $ this -> layout -> GetUserGroupRights ( ) ) ; $ this -> InitAreas ( ) ; $ this -> AddNameField ( ) ; $ this -> AddAreasField ( ) ; $ this -> AddUserGroupField ( ) ; $ this -> Ad... | Initializes the layout form |
238,378 | private function AddAreasField ( ) { $ name = 'Areas' ; $ field = Input :: Text ( $ name , join ( ', ' , $ this -> areaNames ) ) ; $ this -> AddField ( $ field ) ; if ( $ this -> layout -> Exists ( ) ) { $ field -> SetHtmlAttribute ( 'readonly' , 'readonly' ) ; } else { $ this -> SetTransAttribute ( $ name , 'placehold... | Adds the server path field to the form |
238,379 | protected function OnSuccess ( ) { $ action = Action :: Update ( ) ; $ isNew = ! $ this -> layout -> Exists ( ) ; if ( $ isNew ) { $ action = Action :: Create ( ) ; $ this -> layout -> SetUser ( self :: Guard ( ) -> GetUser ( ) ) ; } $ oldFile = $ isNew ? '' : PathUtil :: LayoutTemplate ( $ this -> layout ) ; $ this ->... | Saves the layout |
238,380 | public function getById ( $ id ) { if ( isset ( $ this -> elements [ $ id ] ) ) { return $ this -> elements [ $ id ] ; } throw new \ InvalidArgumentException ( sprintf ( 'Element for id %s does not exist' , $ id ) ) ; } | Get an entity by its ID |
238,381 | public function buildConfigField ( FormEvent $ event ) { $ data = $ event -> getData ( ) ; if ( is_null ( $ data ) ) { return ; } $ propertyPath = is_array ( $ data ) ? '[factoryName]' : 'factoryName' ; $ factoryName = PropertyAccess :: createPropertyAccessor ( ) -> getValue ( $ data , $ propertyPath ) ; if ( empty ( $... | Builds the config field . |
238,382 | public function innerJoin ( $ table , ... $ criterion ) : self { $ this -> join [ ] = $ this -> joinArgumentsToJoinObject ( 'INNER' , $ table , $ criterion ) ; return $ this ; } | Adds a table joined with the inner rule . |
238,383 | public function outerJoin ( $ table , ... $ criterion ) : self { $ this -> join [ ] = $ this -> joinArgumentsToJoinObject ( 'OUTER' , $ table , $ criterion ) ; return $ this ; } | Adds a table joined with the outer rule . |
238,384 | public function leftJoin ( $ table , ... $ criterion ) : self { $ this -> join [ ] = $ this -> joinArgumentsToJoinObject ( 'LEFT' , $ table , $ criterion ) ; return $ this ; } | Adds a table joined with the left rule . |
238,385 | public function rightJoin ( $ table , ... $ criterion ) : self { $ this -> join [ ] = $ this -> joinArgumentsToJoinObject ( 'RIGHT' , $ table , $ criterion ) ; return $ this ; } | Adds a table joined with the right rule . |
238,386 | protected function joinArgumentsToJoinObject ( string $ type , $ table , array $ criterion = [ ] ) : Join { if ( is_array ( $ table ) ) { $ tableName = $ table [ 0 ] ?? null ; $ tableAlias = $ table [ 1 ] ?? null ; } else { $ tableName = $ table ; $ tableAlias = null ; } $ tableName = $ this -> checkStringValue ( 'Argu... | Converts join method arguments to a join object |
238,387 | protected function passthruParameter ( & $ dto , $ variableName ) { $ reqName = str_replace ( '.' , '_' , $ variableName ) ; if ( $ this -> Request -> getParameter ( $ reqName ) !== null && $ this -> Request -> getParameter ( $ reqName ) != '' ) $ dto -> setParameter ( $ variableName , $ this -> Request -> getParameter... | copied from AbstractController |
238,388 | public function matchWhen ( $ url = null ) { if ( null !== $ url ) { $ this -> setMatchUrl ( $ url ) ; } return strpos ( $ this -> getRequestedUrl ( ) , $ this -> getMatchUrl ( ) ) === 0 ; } | match uri for when ( method |
238,389 | public function apply ( $ value ) { $ modified = false ; foreach ( $ this -> filters as $ filter ) { $ result = $ filter -> apply ( $ value ) ; if ( $ result === false ) { return false ; } elseif ( $ result === true ) { } else { $ modified = true ; $ value = $ result ; } } return $ modified ? $ value : true ; } | Returns true if all filters allow the value |
238,390 | public function setData ( array $ data ) { $ reservedDataKeys = array ( 'from' , 'notification' , 'to' , 'registration_ids' , 'collapse_key' , 'priority' , 'restricted_package_name' , 'content_available' , 'delay_while_idle' , 'dry_run' , 'time_to_live' , 'data' , ) ; foreach ( $ data as $ key => $ value ) { if ( ! is_... | Set the value of Data . |
238,391 | public function addFilterToQueryBuilder ( QueryBuilder $ qb ) { $ filters = $ this -> dm -> getFilterCollection ( ) -> getFilterCriteria ( $ this -> class ) ; foreach ( $ filters as $ filter ) { $ qb -> addCriteria ( $ filter ) ; } } | Adds filter criteria to a QueryBuilder instance . |
238,392 | private function createDocument ( $ data , $ document = null , $ refresh = false ) { if ( $ this -> class -> isLockable ) { $ lockAttribute = $ this -> class -> getLockMetadata ( ) -> attributeName ; if ( isset ( $ result [ $ lockAttribute ] ) && $ data [ $ lockAttribute ] === LockMode :: PESSIMISTIC_WRITE ) { throw Lo... | Creates or fills a single document object from a query result . |
238,393 | public function createReferenceInverseSideQuery ( PropertyMetadata $ mapping , $ owner ) { $ targetClass = $ this -> dm -> getClassMetadata ( $ mapping -> targetDocument ) ; $ mappedBy = $ targetClass -> getPropertyMetadata ( $ mapping -> mappedBy ) ; $ qb = $ this -> dm -> createQueryBuilder ( $ mapping -> targetDocum... | Build and return a query capable of populating the given inverse - side reference . |
238,394 | public function delete ( $ document ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; $ identifier = $ this -> uow -> getDocumentIdentifier ( $ document ) ; $ qb -> delete ( ) ; $ qb -> setIdentifier ( $ identifier ) ; if ( $ this -> class -> isLockable ) { $ qb -> attr ( $ this -> class -> lo... | Removes a document from DynamoDB |
238,395 | public function insert ( $ document ) { $ class = $ this -> dm -> getClassMetadata ( get_class ( $ document ) ) ; $ changeset = $ this -> uow -> getDocumentChangeSet ( $ document ) ; $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; foreach ( $ class -> propertyMetadata as $ mapping ) { $ new = is... | Insert the provided document . |
238,396 | public function load ( Identifier $ identifier , $ document = null , $ lockMode = LockMode :: NONE ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; $ query = $ qb -> get ( ) -> setIdentifier ( $ identifier ) -> getQuery ( ) ; $ result = $ query -> getSingleMarshalledResult ( ) ; return $ resu... | Find a document by Identifier instance . |
238,397 | public function loadAll ( array $ criteria = [ ] , $ limit = null ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) -> addCriteria ( $ criteria ) ; return $ qb -> getQuery ( ) -> limit ( $ limit ) -> execute ( ) ; } | Load all documents from a table optionally limited by the provided criteria . |
238,398 | private function loadReferenceManyCollectionInverseSide ( PersistentCollectionInterface $ collection ) { $ query = $ this -> createReferenceInverseSideQuery ( $ collection -> getMapping ( ) , $ collection -> getOwner ( ) ) ; $ documents = $ query -> execute ( ) -> toArray ( ) ; foreach ( $ documents as $ key => $ docum... | Populate an inverse - side ReferenceMany association . |
238,399 | private function loadReferenceManyCollectionOwningSide ( PersistentCollectionInterface $ collection ) { $ mapping = $ collection -> getMapping ( ) ; $ identifiers = array_map ( function ( $ referenceData ) use ( $ mapping ) { return $ this -> ap -> loadReference ( $ mapping , $ referenceData ) ; } , $ collection -> get... | Populate an owning - side ReferenceMany association . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.