idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
48,400 | public function altMessage ( $ altMessage ) { try { $ this -> mailer -> IsHTML ( ) ; $ this -> mailer -> AltBody = $ altMessage ; } catch ( phpmailerException $ e ) { throw new EmailException ( $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } return $ this ; } | Sets the alternative email message body . |
48,401 | public function attach ( $ filename ) { try { $ this -> mailer -> AddAttachment ( $ filename ) ; } catch ( phpmailerException $ e ) { throw new EmailException ( $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } return $ this ; } | Attaches the file specified to the email . |
48,402 | public function getFileUpload ( ) { $ propertyName = $ this -> getFileUploadPropertyName ( __FUNCTION__ ) ; if ( isset ( $ this -> fileUploads [ $ propertyName ] ) ) { return $ this -> fileUploads [ $ propertyName ] ; } } | Returns the uploaded file . |
48,403 | public function setFileUpload ( UploadedFile $ file = null ) { $ propertyName = $ this -> getFileUploadPropertyName ( __FUNCTION__ ) ; unset ( $ this -> fileUploads [ $ propertyName ] ) ; if ( $ file instanceof UploadedFile ) { $ this -> fileUploads [ $ propertyName ] = $ file ; } } | Sets the uploaded file . |
48,404 | private function getFileUploadPropertyName ( $ realCallerMethod ) { $ backtrace = debug_backtrace ( DEBUG_BACKTRACE_IGNORE_ARGS , 3 ) ; $ callerMethodName = $ backtrace [ 1 ] [ 'function' ] ; if ( $ callerMethodName === $ realCallerMethod ) { $ callerMethodName = $ backtrace [ 2 ] [ 'function' ] ; } return lcfirst ( su... | Returns file upload name based on the called method name . |
48,405 | public function createService ( ServiceLocatorInterface $ serviceLocator ) { $ config = $ serviceLocator -> get ( 'Config' ) ; $ viewConfig = isset ( $ config [ 'view' ] ) ? $ config [ 'view' ] : array ( ) ; $ className = isset ( $ viewConfig [ 'classname' ] ) ? $ viewConfig [ 'classname' ] : 'HumusMvc\View\View' ; $ v... | Create view service |
48,406 | public function archiveAction ( string $ production_slug , PaginatorInterface $ paginator , AuthorizationCheckerInterface $ auth , Request $ request ) : Response { $ production_repo = $ this -> em -> getRepository ( Production :: class ) ; if ( null === $ production = $ production_repo -> findOneBy ( [ 'slug' => $ prod... | Show a list of archived resources for a production . |
48,407 | public function createAction ( string $ production_slug , TokenStorageInterface $ token , AuthorizationCheckerInterface $ auth , Request $ request ) : Response { $ production_repo = $ this -> em -> getRepository ( Production :: class ) ; if ( null === $ production = $ production_repo -> findOneBy ( [ 'slug' => $ produc... | Create a new resource in a production . |
48,408 | public function readAction ( int $ id , string $ production_slug , AuthorizationCheckerInterface $ auth ) : Response { list ( $ resource , $ production ) = $ this -> lookupEntity ( Resource :: class , $ id , $ production_slug ) ; if ( ! $ auth -> isGranted ( 'view' , $ resource ) ) { throw new AccessDeniedException ( )... | Read a resource from this production . |
48,409 | public function updateAction ( int $ id , string $ production_slug , Request $ request , AuthorizationCheckerInterface $ auth ) : Response { list ( $ resource , $ production ) = $ this -> lookupEntity ( Resource :: class , $ id , $ production_slug ) ; if ( ! $ auth -> isGranted ( 'edit' , $ resource ) ) { throw new Acc... | Update a resource for this production . |
48,410 | public static function getConnection ( $ hostname , $ dbname ) { if ( isset ( self :: $ dbConnections [ $ hostname ] ) ) { $ conn = self :: $ dbConnections [ $ hostname ] ; } else { $ section = new kfLogSection ( __METHOD__ ) ; try { $ conn = new LoggedPDO ( 'mysql:host=' . $ hostname . ';dbname=' . $ dbname . '_p;char... | Get a database connection by hostname |
48,411 | public static function getDB ( $ dbname ) { if ( $ dbname === 'meta' ) { return self :: getMetaDB ( ) ; } $ wikiInfo = self :: getDbInfo ( $ dbname ) ; if ( ! $ wikiInfo [ 'slice' ] ) { throw new Exception ( "Incomplete database information for '$dbname'" ) ; } return self :: getConnection ( $ wikiInfo [ 'slice' ] , $ ... | Get a database connection by dbname . |
48,412 | public static function getAllWikiInfos ( ) { if ( ! isset ( self :: $ wikiInfos ) ) { $ wikiInfos = self :: getAllDbInfos ( ) ; foreach ( $ wikiInfos as $ dbname => & $ wikiInfo ) { if ( ! $ wikiInfo [ 'url' ] ) { unset ( $ wikiInfos [ $ dbname ] ) ; } } self :: $ wikiInfos = $ wikiInfos ; } return self :: $ wikiInfos ... | Like getAllDbInfos but without databases that aren t wikis . |
48,413 | protected static function generalizeSQL ( $ sql ) { $ sql = str_replace ( "\\\\" , '' , $ sql ) ; $ sql = str_replace ( "\\'" , '' , $ sql ) ; $ sql = str_replace ( "\\\"" , '' , $ sql ) ; $ sql = preg_replace ( "/'.*'/s" , "'X'" , $ sql ) ; $ sql = preg_replace ( '/".*"/s' , "'X'" , $ sql ) ; $ sql = preg_replace ( '/... | Remove most variables from an SQL query and replace them with X or N markers . |
48,414 | public function setupParams ( $ params = [ ] ) { if ( is_array ( $ params ) ) { $ this -> params = array_merge ( $ this -> params , $ params ) ; } return $ this ; } | Sets fixed parameters to be sent in all calls |
48,415 | public function call ( $ url , $ method = 'GET' , $ params = [ ] ) { $ params = array_merge ( $ this -> params , is_array ( $ params ) ? $ params : [ ] ) ; $ content = '' ; $ queryString = http_build_query ( $ params ) ; if ( $ method === 'GET' ) { $ url = $ url . '?' . $ queryString ; } else { $ content = $ queryStrin... | Makes an HTTP call |
48,416 | public function send ( string $ priority , string $ message , array $ context = [ ] ) { if ( ! $ this -> contextContainsException ( $ context ) ) { $ data = [ 'extra' => $ this -> sanitizer -> sanitize ( $ context ) , 'level' => $ priority , ] ; $ this -> client -> captureMessage ( $ message , [ ] , $ data , $ this -> ... | Send the log |
48,417 | public function to ( string $ target ) : Date { $ modifiedHandle = clone $ this -> originalDate -> handle ( ) ; $ modifiedHandle -> modify ( $ target ) ; return new Date ( $ modifiedHandle ) ; } | returns a new date instance which represents the changed date |
48,418 | public function timeTo ( string $ time ) : Date { $ times = explode ( ':' , $ time ) ; if ( count ( $ times ) != 3 ) { throw new \ InvalidArgumentException ( 'Given time "' . $ time . '" does not follow required format HH:MM:SS' ) ; } list ( $ hour , $ minute , $ second ) = $ times ; if ( ! ctype_digit ( $ hour ) || 0 ... | returns a new date instance with same date but changed time |
48,419 | public function hourTo ( int $ hour ) : Date { return $ this -> createDateWithNewTime ( $ hour , $ this -> originalDate -> minutes ( ) , $ this -> originalDate -> seconds ( ) ) ; } | returns a new date instance with same date minute and second but changed hour |
48,420 | public function byHours ( int $ hours ) : Date { return $ this -> hourTo ( $ this -> originalDate -> hours ( ) + $ hours ) ; } | changes date by given amount of hours |
48,421 | public function minuteTo ( int $ minute ) : Date { return $ this -> createDateWithNewTime ( $ this -> originalDate -> hours ( ) , $ minute , $ this -> originalDate -> seconds ( ) ) ; } | returns a new date instance with same date hour and second but changed minute |
48,422 | public function byMinutes ( int $ minutes ) : Date { return $ this -> minuteTo ( $ this -> originalDate -> minutes ( ) + $ minutes ) ; } | changes date by given amount of minutes |
48,423 | public function secondTo ( int $ second ) : Date { return $ this -> createDateWithNewTime ( $ this -> originalDate -> hours ( ) , $ this -> originalDate -> minutes ( ) , $ second ) ; } | returns a new date instance with same date hour and minute but changed second |
48,424 | public function bySeconds ( int $ seconds ) : Date { return $ this -> secondTo ( $ this -> originalDate -> seconds ( ) + $ seconds ) ; } | changes date by given amount of seconds |
48,425 | private function createDateWithNewTime ( int $ hour , int $ minute , int $ second ) : Date { return new Date ( $ this -> originalDate -> handle ( ) -> setTime ( $ hour , $ minute , $ second ) ) ; } | creates new date instance with changed time |
48,426 | public function dateTo ( string $ date ) : Date { $ dates = explode ( '-' , $ date ) ; if ( count ( $ dates ) != 3 ) { throw new \ InvalidArgumentException ( 'Given date "' . $ date . '" does not follow required format YYYY-MM-DD' ) ; } list ( $ year , $ month , $ day ) = $ dates ; if ( ! ctype_digit ( $ year ) ) { thr... | returns a new date instance with changed date but same time |
48,427 | public function byYears ( int $ years ) : Date { return $ this -> yearTo ( $ this -> originalDate -> year ( ) + $ years ) ; } | changes date by given amount of years |
48,428 | public function byMonths ( int $ months ) : Date { return $ this -> monthTo ( $ this -> originalDate -> month ( ) + $ months ) ; } | changes date by given amount of months |
48,429 | public function dayTo ( int $ day ) : Date { return $ this -> createNewDateWithExistingTime ( $ this -> originalDate -> year ( ) , $ this -> originalDate -> month ( ) , $ day ) ; } | returns a new date instance with changed day but same time year and month |
48,430 | public function byDays ( int $ days ) : Date { return $ this -> dayTo ( $ this -> originalDate -> day ( ) + $ days ) ; } | changes date by given amount of days |
48,431 | private function createNewDateWithExistingTime ( int $ year , int $ month , int $ day ) : Date { return new Date ( $ this -> originalDate -> handle ( ) -> setDate ( $ year , $ month , $ day ) ) ; } | creates new date instance with changed date but same time |
48,432 | public function buildProvider ( string $ key , array $ options = [ ] ) { $ provider = $ this -> get ( $ key ) ; switch ( $ provider [ 'Type' ] ) { case "Database" : if ( ! isset ( $ options [ 'storageHandler' ] ) || ! $ options [ 'storageHandler' ] instanceof \ Nuki \ Skeletons \ Handlers \ StorageHandler ) { throw new... | Build a provider by its key and additional options |
48,433 | private static function getTranslations ( array $ words ) { $ result = array ( ) ; foreach ( $ words as $ i ) { $ result = array_merge ( $ result , array ( ucfirst ( $ i ) , strtoupper ( $ i ) , strtolower ( $ i ) ) ) ; } return $ result ; } | Given a set of words perform the appropriate translations on them to match the YAML 1 . 1 specification for type coercing . |
48,434 | public function redirectTo ( $ location ) { $ app = $ GLOBALS [ 'app' ] ; $ host = $ _SERVER [ 'HTTP_HOST' ] ; if ( isset ( $ _SERVER [ 'HTTP_X_FORWARDED_HOST' ] ) ) { $ host = $ _SERVER [ 'HTTP_X_FORWARDED_HOST' ] ; } $ protocol = isset ( $ _SERVER [ 'HTTPS' ] ) ? 'https://' : 'http://' ; $ redirectLocation = $ protoc... | redirectTo Helper method to allow redirection to a certain url . |
48,435 | public function logout ( ) { $ this -> di -> get ( 'session' ) -> set ( "user" , null ) ; $ this -> di -> get ( "response" ) -> redirect ( "user/login" ) ; } | Logout user by setting user == null in session . |
48,436 | protected function getCalleeClass ( ) { if ( PHP_VERSION_ID < 50205 ) $ backtrace = debug_backtrace ( ) ; else $ backtrace = debug_backtrace ( false ) ; foreach ( $ backtrace as $ bt ) { if ( ! is_a ( $ this , $ bt [ 'class' ] ) && strpos ( $ bt [ 'class' ] , 'Logger' ) === false ) { return $ bt [ 'class' ] ; } } retur... | Returns the name of the class that called the logger function |
48,437 | public function getLogHistory ( $ klass = null ) { if ( empty ( $ klass ) ) return $ this -> history ; if ( ! isset ( $ this -> history [ $ klass ] ) ) return array ( ) ; return $ this -> history [ $ klass ] ; } | This function returns the current array of log message for a particular category . |
48,438 | public function clearLogHistory ( $ klass = null ) { if ( empty ( $ klass ) ) $ this -> history = array ( ) ; if ( ! isset ( $ this -> history [ $ klass ] ) ) return ; $ this -> history [ $ klass ] = array ( ) ; } | This function clears the current array of log message for a particular category . |
48,439 | public function write ( ) { $ gemfile = '' ; foreach ( $ this -> parameters as $ gem ) { $ line = str_replace ( '<gem>' , $ gem , self :: $ template ) ; $ gemfile = sprintf ( '%s%s%s' , $ gemfile , PHP_EOL , $ line ) ; } $ gemfile .= self :: $ sourceTemplate ; fwrite ( $ this -> file , $ this -> addHeaders ( $ gemfile ... | Writes Gemfile . |
48,440 | public function cacheObject ( $ key , $ object , $ timeoutSeconds = - 1 ) { $ cache = HttpSession :: instance ( ) -> getValue ( "__SESSION_CACHED_ITEMS" ) ; if ( ! is_array ( $ cache ) ) { $ cache = array ( ) ; } $ cache [ $ key ] = $ object ; HttpSession :: instance ( ) -> setValue ( "__SESSION_CACHED_ITEMS" , $ cache... | Cache an object with a key and an optional timeout in seconds . |
48,441 | public function getCachedObject ( $ key ) { $ cache = HttpSession :: instance ( ) -> getValue ( "__SESSION_CACHED_ITEMS" ) ; $ timeouts = HttpSession :: instance ( ) -> getValue ( "__SESSION_CACHE_TIMEOUTS" ) ; if ( is_array ( $ timeouts ) && isset ( $ timeouts [ $ key ] ) ) { $ now = new \ DateTime ( ) ; $ expiry = da... | Get a cached object by key |
48,442 | public function getPageUrl ( PagerfantaInterface $ pagerfanta , $ page , array $ options = array ( ) ) { if ( $ page < 0 || $ page > $ pagerfanta -> count ( ) ) { throw new \ InvalidArgumentException ( "Page '{$page}' is out of bounds" ) ; } $ routeGenerator = $ this -> createRouteGenerator ( $ options ) ; return $ rou... | Generates the url for a given page in a pagerfanta instance . |
48,443 | private function createRouteGenerator ( $ options = array ( ) ) { $ options = array_replace ( array ( 'routeName' => null , 'routeParams' => array ( ) , 'pageParameter' => '[page]' , ) , $ options ) ; $ router = $ this -> container -> get ( 'router' ) ; if ( null === $ options [ 'routeName' ] ) { $ request = $ this -> ... | Creates an anonymous function which returns the URL for a given page . |
48,444 | public function build ( array $ schemaDesc ) : Schema { $ this -> schemaDesc = $ schemaDesc ; $ schema = new Schema ( ) ; foreach ( $ schemaDesc [ 'tables' ] as $ name => $ tableDesc ) { $ table = $ schema -> createTable ( $ name ) ; $ this -> buildTable ( $ tableDesc , $ table ) ; } return $ schema ; } | Build an array descriptor into a Schema object |
48,445 | public static function fromValueForClass ( $ value , string $ class ) { $ message = sprintf ( 'Failed to validate value of type %1$s to fit into Value object of type %2$s. (%3$s)' , is_object ( $ value ) ? get_class ( $ value ) : gettype ( $ value ) , $ class , json_encode ( $ value ) ) ; return new static ( $ message ... | Create a new exception instance from a failing value . |
48,446 | public function addCopyRecord ( CopyRecord $ record ) { if ( $ this -> getCopyRecordByItemNumber ( $ record -> getItemNumber ( ) ) ) { throw new InvalidArgumentException ( "Cannot add copy record: Copy record with item number {$record->getItemNumber()} already present" ) ; } $ this -> addRecord ( $ record ) ; $ record ... | Add a copy record . |
48,447 | public function getCopyRecordByItemNumber ( $ itemNumber ) { foreach ( $ this -> _records as $ record ) { if ( $ record -> getItemNumber ( ) === $ itemNumber ) { return $ record ; } } return null ; } | Return copy record by item number . |
48,448 | public function setTitleRecord ( TitleRecord $ record ) { $ this -> unsetTitleRecord ( ) ; if ( ! $ record -> containsLocalRecord ( $ this ) ) { $ record -> addLocalRecord ( $ this ) ; } $ this -> _parent = $ record ; } | Set the containing title record . |
48,449 | public function unsetTitleRecord ( ) { if ( $ this -> _parent ) { if ( $ this -> _parent -> containsLocalRecord ( $ this ) ) { $ this -> _parent -> removeLocalRecord ( $ this ) ; } $ this -> _parent = null ; } } | Unset the containing title record . |
48,450 | public function getParameterQNames ( ) { $ result = array ( ) ; $ forQNames = array ( ) ; $ this -> traverseNodes ( $ this -> exprTree , function ( $ node ) use ( & $ result , & $ forQNames ) { if ( $ node instanceof ForNode ) { $ forQNames [ ] = $ node -> getQNVarName ( ) ; } else if ( $ node instanceof VarRefNode ) {... | Return an array of parameter names |
48,451 | public function isFunctionUsed ( $ functions ) { if ( is_string ( $ functions ) ) { $ functions = array ( $ functions ) ; } $ result = $ this -> traverseNodes ( $ this -> exprTree , function ( $ node ) use ( & $ result , $ functions ) { return true ; } ) ; return ! $ result ; } | Checks to see is one or any of a collection of functions are used in an expression |
48,452 | private function getCostCollection ( OrderInterface $ order ) : Collection { if ( $ order -> hasShippingMethod ( ) ) { $ costs = $ this -> getCurrentShippingMethodCostsCollection ( $ order ) ; if ( $ costs -> count ( ) > 0 ) { return $ costs ; } } return $ this -> getShippingCostCollection ( $ order ) ; } | Returns the costs collection for existing shipping method or all shipping methods if current method is not longer available |
48,453 | private function getCurrentShippingMethodCostsCollection ( OrderInterface $ order ) : Collection { return $ this -> methodProvider -> getShippingMethodCosts ( $ order -> getShippingMethod ( ) , new OrderContext ( $ order ) ) ; } | Returns the collection of costs for current shipping method |
48,454 | public static function getByMimeType ( ? string $ mimeType ) : int { switch ( explode ( '/' , ( string ) $ mimeType ) [ 0 ] ?? null ) { case 'image' : return static :: IMAGE ; case 'audio' : return static :: AUDIO ; case 'video' : return static :: VIDEO ; default : return static :: FILE ; } } | Returns file type by its mime type . |
48,455 | public function literal ( $ input , $ type = null ) { if ( ! is_string ( $ input ) ) { return $ input ; } return $ this -> connection -> quote ( $ input , $ type ) ; } | Quotes a given input parameter . |
48,456 | private function processChangePassword ( User $ user , $ password , $ confirmPassword ) { if ( empty ( $ password ) ) { return Errors :: PASSWORD_INVALID ; } if ( $ password !== $ confirmPassword ) { return Errors :: CONFIRM_PASSWORD_INVALID ; } $ mapper = MapperFactory :: getUserMapper ( ) ; $ user -> setPassword ( $ ... | Change the password of a user and sent them on their way . |
48,457 | private function verifyRecaptcha ( ) { if ( ! isset ( $ this -> recaptchaClientKey ) ) { return true ; } $ recaptcha = $ this -> request -> input ( 'g-recaptcha-response' ) ; if ( ! $ recaptcha ) { return false ; } $ request = new Request ( ) ; $ request -> setUrl ( 'https://www.google.com/recaptcha/api/siteverify' ) ;... | Verify recaptcha code |
48,458 | public function setCache ( $ key , $ value , $ ttl = 0 ) { $ cache_function = $ this -> set_cache_callback ; return $ cache_function ( $ this -> cache_type , array ( 'key' => $ key , 'value' => $ value , 'ttl' => $ ttl ) ) ; } | Persist data in cache |
48,459 | public function useCache ( ) { if ( is_callable ( $ this -> get_cache_callback ) && is_callable ( $ this -> set_cache_callback ) && is_callable ( $ this -> delete_cache_callback ) ) { return true ; } return false ; } | Determine if Cache is activated for this type |
48,460 | public function setConfig ( array $ config ) { foreach ( $ config as $ name => $ value ) { $ setter = 'set' . ucfirst ( $ name ) ; call_user_func_array ( array ( $ this , $ setter ) , array ( $ value ) ) ; } } | Sets the configuration of the builder . |
48,461 | public function getDocumentEntityRepository ( ) { if ( isset ( $ this -> er [ 'Document' ] ) ) { return $ this -> er [ 'Document' ] ; } $ sphinxClient = $ this -> getServiceManager ( ) -> get ( 'sphinxsearch.client.default' ) ; $ entityRepository = $ this -> getEntityManager ( ) -> getRepository ( 'Neobazaar\Entity\Doc... | Get Neobazaar \ Entity \ Document entity repository |
48,462 | public function getTermTaxonomyEntityRepository ( ) { if ( isset ( $ this -> er [ 'TermTaxonomy' ] ) ) { return $ this -> er [ 'TermTaxonomy' ] ; } $ this -> er [ 'TermTaxonomy' ] = $ this -> getEntityManager ( ) -> getRepository ( 'Neobazaar\Entity\TermTaxonomy' ) ; return $ this -> er [ 'TermTaxonomy' ] ; } | Get Neobazaar \ Entity \ TermTaxonomy entity repository |
48,463 | public function getGeonamesEntityRepository ( ) { if ( isset ( $ this -> er [ 'Geonames' ] ) ) { return $ this -> er [ 'Geonames' ] ; } $ this -> er [ 'Geonames' ] = $ this -> getEntityManager ( ) -> getRepository ( 'Neobazaar\Entity\Geonames' ) ; return $ this -> er [ 'Geonames' ] ; } | Get Neobazaar \ Entity \ Geonames entity repository |
48,464 | public function getUserEntityRepository ( ) { if ( isset ( $ this -> er [ 'User' ] ) ) { return $ this -> er [ 'User' ] ; } $ entityRepository = $ this -> getEntityManager ( ) -> getRepository ( 'Neobazaar\Entity\User' ) ; $ entityRepository -> setServiceLocator ( $ this -> getServiceManager ( ) ) ; $ this -> er [ 'Use... | Get Neobazaar \ Entity \ USer entity repository |
48,465 | public static function create ( Validator $ validator = null ) : self { return new self ( new ClosureContainer ( [ 'rollerworks_search.input.json' => function ( ) use ( $ validator ) { return new Input \ JsonInput ( $ validator ) ; } , 'rollerworks_search.input.string_query' => function ( ) use ( $ validator ) { return... | Create a new InputProcessorLoader with the build - in InputProcessors loadable . |
48,466 | protected function load ( ) { $ path = $ this -> vendorDir . '/composer' ; if ( ! is_dir ( $ path ) ) throw new InvalidProjectException ( '"composer" folder has not been found. Be sure to use this bundle on a project managed by Composer' ) ; $ map = require $ path . '/autoload_namespaces.php' ; foreach ( $ map as $ nam... | Loads the bundles when the autoload . json file exists parsing the autoload_namespaces . php file generated by composer |
48,467 | protected function parseExtraFolders ( ) { foreach ( $ this -> extraFolders as $ folder ) { $ finder = new Finder ( ) ; if ( is_dir ( $ folder ) ) { $ bundleFolders = $ finder -> directories ( ) -> depth ( 0 ) -> in ( $ folder ) ; foreach ( $ bundleFolders as $ bundleFolder ) { $ bundleName = basename ( $ bundleFolder ... | parses extra folders to look for autoloaders in different path than the ones saved into the composer file |
48,468 | protected function hasAutoloader ( $ path ) { if ( is_dir ( $ path ) ) { $ finder = new \ Symfony \ Component \ Finder \ Finder ( ) ; $ bundles = $ finder -> files ( ) -> depth ( 0 ) -> name ( 'autoload.json' ) -> in ( $ path ) ; if ( count ( $ bundles ) == 1 ) { return true ; } } return false ; } | Checks if the bundle has an autoloader . json file |
48,469 | public function getRange_ ( $ start , $ end ) { $ ret = new PrettyArray ( ) ; $ collecting = false ; $ start = ( string ) $ start ; $ end = ( string ) $ end ; foreach ( $ this -> data as $ key => & $ value ) { $ key = ( string ) $ key ; if ( $ start == $ key || $ collecting ) { $ collecting = true ; $ ret -> setByRefer... | Will get a range from PrettyArray . Calling it destructively will force the return value to be references to the current PrettyArray . |
48,470 | public function key ( ) { $ keys = array_keys ( $ this -> data ) ; return isset ( $ keys [ $ this -> position ] ) ? $ keys [ $ this -> position ] : null ; } | Retrieve the current key . Part of the Iterator interface . |
48,471 | public function isValid ( $ value ) { $ filePath = GeneralUtility :: getFileAbsFileName ( $ value ) ; if ( false === GeneralUtility :: getUrl ( $ filePath ) ) { $ errorMessage = $ this -> translateErrorMessage ( 'validator.file_exists.not_valid' , 'configuration_object' , [ $ value ] ) ; $ this -> addError ( $ errorMes... | Checks if the value is a path to an existing file . |
48,472 | protected function setCssContent ( $ cssContent , $ optionalFlags = null ) { $ attr = [ ] ; if ( is_null ( $ optionalFlags ) ) { $ attr [ 'media' ] = 'all' ; } else { $ knownAttributes = [ 'media' ] ; foreach ( $ knownAttributes as $ value ) { if ( array_key_exists ( $ value , $ optionalFlags ) ) { $ attr [ $ value ] =... | Returns css codes |
48,473 | protected function setCssFile ( $ cssFileName , $ hostsWithoutCDNrq = null ) { if ( is_null ( $ hostsWithoutCDNrq ) ) { $ hostsWithoutCDNrq = [ ] ; } if ( in_array ( $ this -> getClientRealIpAddress ( ) , $ hostsWithoutCDNrq ) ) { return '<link rel="stylesheet" type="text/css" href="' . filter_var ( $ cssFileName , FIL... | Returns css link to a given file |
48,474 | protected function setFormJavascriptFinal ( $ frmId ) { $ cnt = implode ( PHP_EOL , [ '$(document).ready(function(){' , '$("form#' . $ frmId . '").submit(function(){' , '$("form#' . $ frmId . ' input[type=checkbox]").attr("readonly", true);' , '$("form#' . $ frmId . ' input[type=password]").attr("readonly", true);' , '... | Builds javascript to avoid multiple form submission |
48,475 | protected function setJavascriptFile ( $ jsFileName , $ hostsWithoutCDNrq = null ) { if ( is_null ( $ hostsWithoutCDNrq ) ) { $ hostsWithoutCDNrq = [ ] ; } if ( in_array ( $ this -> getClientRealIpAddress ( ) , $ hostsWithoutCDNrq ) ) { return '<script type="text/javascript" src="' . filter_var ( $ jsFileName , FILTER_... | Returns javascript link to a given file |
48,476 | protected function getStructureType ( string $ structure , int $ lvl ) : array { $ structureType = "" ; $ dataType = "" ; if ( $ structure === "mixed" || $ structure === "?mixed" ) { $ structureType .= "nullable-" ; $ structure = "mixed" ; } elseif ( strpos ( $ structure , "?" ) === 0 ) { $ structureType .= "nullable-"... | Retorna o tipo de estrutura de dados que a string passada representa . |
48,477 | public function exec ( $ sql = "" , $ bindingValues = array ( ) , $ insert = true ) { if ( preg_match ( "/.*(SELECT|INSERT|UPDATE|SHOW|DELETE).*/" , $ sql ) ) { $ this -> sql = $ sql ; $ query = $ this -> connection -> prepare ( $ sql ) ; if ( preg_match ( '/\s*:(.+?)\s/' , $ sql ) ) { if ( is_array ( $ bindingValues )... | Executes the current SQL query . Returns a ASSOC result set . |
48,478 | protected function convertWhereToString ( array $ whereArray = array ( ) , $ concatenationOperator = " AND " , $ assignmentOperator = "=" ) { if ( empty ( $ whereArray ) ) { return false ; } $ returnWhereStringToken = array ( ) ; foreach ( $ whereArray as $ key => $ val ) { $ _key = strtoupper ( $ key ) ; if ( ( in_arr... | This function converts an array into a Where String . |
48,479 | public function getOneResult ( $ table , $ where = null , $ groupBy = null , $ orderBy = null ) { return $ this -> Select ( $ table , $ where , $ groupBy , $ orderBy , 1 ) ; } | Executes the current SQL query and returns the first result as ASSOC result set |
48,480 | public function Insert ( $ table , $ data = array ( ) ) { if ( empty ( $ table ) || empty ( $ data ) ) { return false ; } foreach ( $ data as $ key => $ val ) { if ( empty ( $ val ) ) { unset ( $ data [ $ key ] ) ; } } $ columns = array_keys ( $ data ) ; if ( ! empty ( $ columns ) ) { $ insert = $ this -> queryFactory ... | Saves the data in the table with a new id ; |
48,481 | private function getClassExtends ( ) { if ( $ this -> isMultiton ( ) ) { $ this -> class -> addUses ( '\Bond\Repository\Multiton as RM' ) ; $ this -> class -> addExtends ( 'RM' ) ; } else { $ this -> class -> addUses ( '\Bond\Repository as R' ) ; $ this -> class -> addExtends ( 'R' ) ; } } | Class to extend |
48,482 | private function getClassConstants ( ) { $ pgClass = $ this -> entity -> pgClass ; $ this -> class -> classComponents [ ] = new ClassConstant ( 'TABLE' , new Sformatf ( "const TABLE = '%s';" , $ pgClass -> getFullyQualifiedName ( ) ) ) ; $ this -> class -> classComponents [ ] = new ClassConstant ( 'PARENT' , new Sforma... | Get class constants |
48,483 | private function setClassComment ( ) { $ connectionSettings = $ this -> entity -> pgClass -> getCatalog ( ) -> db -> resource -> connectionSettings ; $ header = new Sformatf ( <<<TEXT ConnectionInfo %s@%s:%s, Relation %sTEXT , $ connectionSettings -> dbname , $ connectionSettings -> user , $ conn... | Entity generated Headers |
48,484 | private function getOptionsResolverFunctionDeclaration ( ) { $ required = [ ] ; $ optional = [ ] ; $ allowedValues = [ ] ; foreach ( $ this -> entity -> dataTypes as $ name => $ dataType ) { if ( ! $ dataType -> getDefault ( ) and ! $ dataType -> isNullable ( ) ) { $ required [ ] = $ name ; } else { $ optional [ ] = $ ... | Generate a get Options Resolver component for the enity |
48,485 | public function getAndClearBuffer ( $ trim = "" , $ tolower = false ) { $ r = $ this -> getBuffer ( $ trim , $ tolower ) ; $ this -> buffer = "" ; return $ r ; } | Returns and clear the current buffer . |
48,486 | public function getPlugin ( $ class ) { static $ index = null ; if ( is_null ( $ index ) ) { $ index = array ( ) ; for ( $ i = 0 , $ l = count ( $ this -> plugins ) ; $ i < $ l ; $ i ++ ) { $ index [ get_class ( $ this -> plugins [ $ i ] ) ] = $ i ; } } return isset ( $ index [ $ class ] ) ? $ this -> plugins [ $ index... | Returns a plugin by class name . |
48,487 | public function popState ( ) { $ r = array_pop ( $ this -> states ) ; $ this -> state = $ this -> states [ count ( $ this -> states ) - 1 ] ; return $ r ; } | Remove the last state of the state stack and return the removed stack value . |
48,488 | public function pushState ( $ state ) { $ r = array_push ( $ this -> states , $ state ) ; $ this -> state = $ this -> states [ count ( $ this -> states ) - 1 ] ; return $ r ; } | Adds a new state onto the state stack . |
48,489 | public function minify ( $ source ) { $ r = "" ; $ parser = new CssParser ( $ source ) ; $ tokens = $ parser -> getTokens ( ) ; $ filters = $ this -> filters ; $ filterCount = count ( $ this -> filters ) ; $ plugins = $ this -> plugins ; $ pluginCount = count ( $ plugins ) ; $ pluginIndex = array ( ) ; $ pluginTriggerT... | Minifies the CSS source . |
48,490 | public static function initialise ( ) { $ paths = array ( dirname ( __FILE__ ) ) ; while ( list ( $ i , $ path ) = each ( $ paths ) ) { $ subDirectorys = glob ( $ path . "*" , GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT ) ; if ( is_array ( $ subDirectorys ) ) { foreach ( $ subDirectorys as $ subDirectory ) { $ paths [ ] = $... | Initialises CssMin . |
48,491 | public static function minify ( $ source , array $ filters = null , array $ plugins = null ) { self :: $ errors = array ( ) ; $ minifier = new CssMinifier ( $ source , $ filters , $ plugins ) ; return $ minifier -> getMinified ( ) ; } | Minifies CSS source . |
48,492 | public static function parse ( $ source , array $ plugins = null ) { self :: $ errors = array ( ) ; $ parser = new CssParser ( $ source , $ plugins ) ; return $ parser -> getTokens ( ) ; } | Parse the CSS source . |
48,493 | private function hsl2hex ( $ hue , $ saturation , $ lightness ) { $ hue = $ hue / 360 ; $ saturation = $ saturation / 100 ; $ lightness = $ lightness / 100 ; if ( $ saturation == 0 ) { $ red = $ lightness * 255 ; $ green = $ lightness * 255 ; $ blue = $ lightness * 255 ; } else { if ( $ lightness < 0.5 ) { $ v2 = $ lig... | Convert a HSL value to hexadecimal notation . |
48,494 | private function hue2rgb ( $ v1 , $ v2 , $ hue ) { if ( $ hue < 0 ) { $ hue += 1 ; } if ( $ hue > 1 ) { $ hue -= 1 ; } if ( ( 6 * $ hue ) < 1 ) { return ( $ v1 + ( $ v2 - $ v1 ) * 6 * $ hue ) ; } if ( ( 2 * $ hue ) < 1 ) { return ( $ v2 ) ; } if ( ( 3 * $ hue ) < 2 ) { return ( $ v1 + ( $ v2 - $ v1 ) * ( ( 2 / 3 ) - $ ... | Apply hue to a rgb color value . |
48,495 | public function getChangelogMinDate ( ) { $ result = null ; $ asChange = 'c' ; $ tblChange = $ this -> resource -> getTableName ( EChange :: ENTITY_NAME ) ; $ query = $ this -> conn -> select ( ) ; $ query -> from ( [ $ asChange => $ tblChange ] , [ EChange :: A_DATE_CHANGED ] ) ; $ query -> order ( [ $ asChange . '.' ... | Select MIN date for the existing change log . |
48,496 | public static function requireView ( ) : void { $ medusa = new Medusa ( self :: $ viewsEngine ) ; $ medusa -> setCacheDirectory ( self :: $ viewsCache ) ; $ medusa -> setViewsDirectory ( self :: $ viewsDirectory ) ; $ medusa -> setViewsExtension ( self :: $ viewsExtension ) ; $ medusa -> register ( Partial :: class ) ;... | Create a new Medusa Object |
48,497 | private function getEmailDatas ( $ request , $ e ) { $ session = $ request -> session ( ) -> all ( ) ; return [ 'date' => Carbon :: now ( ) -> format ( 'd.m.Y H:i:s' ) , 'rUser' => $ request -> user ( ) , 'rSessionOld' => isset ( $ session [ 'flash' ] ) ? $ session [ 'flash' ] [ 'old' ] : [ ] , 'rSessionNew' => isset (... | get error email datas |
48,498 | public function toProfiles ( $ profiles , $ campaignId , $ meta = [ ] ) { $ data = [ 'profile_uids' => $ profiles , 'meta' => $ meta ] ; return $ this -> request -> send ( 'POST' , "profiles/campaigns/$campaignId" , $ data ) ; } | Triggers campaign for multiple profiles |
48,499 | public function toChannels ( $ channels , $ campaignId , $ meta = [ ] ) { $ data = [ 'channel_uids' => $ channels , 'meta' => $ meta ] ; return $ this -> request -> send ( 'POST' , "channels/campaigns/$campaignId" , $ data ) ; } | Triggers campaign for multiple channels |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.