idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
239,400 | private function buildUsernameWhere ( $ username ) { $ userClass = $ this -> auth -> getUserClass ( ) ; $ conditions = array_map ( function ( $ prop , $ username ) { return $ prop . " = '" . $ username . "'" ; } , $ userClass :: $ usernameProperties , array_fill ( 0 , count ( $ userClass :: $ usernameProperties ) , add... | Builds a query string for matching the username . |
239,401 | public static function encryptMessage ( $ message , $ key , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'encryptMessage' ) ; Helpers :: isString ( $ key , 'Encryption' , 'encryptMessage' ) ; Helpers :: isString ( $ hashKey , 'Encryption' , 'encryptMessage' ) ; $ key = Hash :: hash ( $ key , $ ha... | Returns an encrypted message in the form of a JSON string . |
239,402 | public static function decryptMessage ( $ message , $ key , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'decryptMessage' ) ; Helpers :: isString ( $ key , 'Encryption' , 'decryptMessage' ) ; Helpers :: isString ( $ hashKey , 'Encryption' , 'decryptMessage' ) ; $ key = Hash :: hash ( $ key , $ ha... | Returns the encrypted message in plaintext format . |
239,403 | public static function signMessage ( $ message , $ key , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'signMessage' ) ; Helpers :: isString ( $ key , 'Encryption' , 'signMessage' ) ; Helpers :: isString ( $ hashKey , 'Encryption' , 'signMessage' ) ; $ key = Hash :: hash ( $ key , $ hashKey , Cons... | Returns a signed message to the client for authentication . |
239,404 | public static function verifyMessage ( $ message , $ key , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'verifyMessage' ) ; Helpers :: isString ( $ key , 'Encryption' , 'verifyMessage' ) ; Helpers :: isString ( $ hashKey , 'Encryption' , 'verifyMessage' ) ; $ key = Hash :: hash ( $ key , $ hashKe... | Validates a message signature and returns the signed message . |
239,405 | public static function encryptSignMessage ( $ message , $ encryptionKey , $ signatureKey , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'encryptSignMessage' ) ; Helpers :: isString ( $ encryptionKey , 'Encryption' , 'encryptSignMessage' ) ; Helpers :: isString ( $ signatureKey , 'Encryption' , 'e... | Sign and encrypt a message for security . |
239,406 | public static function decryptVerifyMessage ( $ message , $ encryptionKey , $ signatureKey , $ hashKey = '' ) { Helpers :: isString ( $ message , 'Encryption' , 'decryptVerifyMessage' ) ; Helpers :: isString ( $ encryptionKey , 'Encryption' , 'decryptVerifyMessage' ) ; Helpers :: isString ( $ signatureKey , 'Encryption... | Verify and decrypt a message for security . |
239,407 | public function getStateElement ( $ state = null ) { if ( is_bool ( $ state ) && ( $ state === true ) ) { $ state = 2 ; } switch ( ( int ) $ state ) { case 2 : $ stateText = $ this -> Html -> tag ( 'span' , '' , [ 'class' => 'fas fa-check' ] ) ; $ titleText = __d ( 'cake_installer' , 'Ok' ) ; $ labelClass = 'label-succ... | Build HTML element with status icon from status value |
239,408 | public function getStateItemClass ( $ state = null ) { if ( is_bool ( $ state ) && ( $ state === true ) ) { $ state = 2 ; } switch ( ( int ) $ state ) { case 2 : $ classItem = '' ; break ; case 1 : $ classItem = 'list-group-item-warning' ; break ; default : $ classItem = 'list-group-item-danger' ; } return $ classItem ... | Return class for list element from status value |
239,409 | public function getStateList ( $ list = null ) { $ result = '' ; if ( empty ( $ list ) ) { return $ result ; } $ listText = '' ; foreach ( $ list as $ listItem ) { $ classItem = '' ; if ( is_array ( $ listItem ) ) { if ( ! isset ( $ listItem [ 'textItem' ] ) ) { continue ; } $ textItem = $ listItem [ 'textItem' ] ; if ... | Return list of states |
239,410 | public function propertyPath ( $ data , $ propertyPath ) { if ( null !== $ propertyPath && ! $ propertyPath instanceof PropertyPathInterface ) { $ propertyPath = new PropertyPath ( $ propertyPath ) ; } if ( $ propertyPath instanceof PropertyPathInterface && ( \ is_object ( $ data ) || $ data instanceof \ ArrayAccess ) ... | Get the data defined by property path . |
239,411 | public static function getIconByExtension ( $ extension ) { if ( 'pdf' === $ extension ) { return 'file-pdf-o' ; } if ( true === in_array ( $ extension , self :: extensionsArchive ( ) ) ) { return 'file-archive-o' ; } if ( true === in_array ( $ extension , self :: extensionsImage ( ) ) ) { return 'file-image-o' ; } if ... | Get FontAwesome Icon By Extension |
239,412 | public function getQuery ( ) { if ( ! $ this -> query ) { $ this -> query = new Query ( $ this -> driver , $ this -> preprocessor ) ; } return $ this -> query ; } | Returns parameter builder |
239,413 | private function createDriver ( array $ config ) { if ( empty ( $ config [ 'driver' ] ) ) { throw new InvalidStateException ( 'Undefined driver' ) ; } elseif ( $ config [ 'driver' ] instanceof IDriver ) { return $ config [ 'driver' ] ; } else { $ name = ucfirst ( $ config [ 'driver' ] ) ; $ class = "Mva\\Dbm\\Driver\\{... | Creates a IDriver instance . |
239,414 | private function ensureIndexNameAttIdLanguage ( ) { if ( ! ( $ this -> database -> tableExists ( 'tl_metamodel_translatedurl' ) ) ) { return ; } if ( ! $ this -> database -> indexExists ( 'att_lang' , 'tl_metamodel_translatedurl' , true ) ) { return ; } $ this -> database -> execute ( 'ALTER TABLE `tl_metamodel_transla... | Ensure that the index types are correct . |
239,415 | private function ensureHrefDefaultsToNull ( ) { if ( ! ( $ this -> database -> tableExists ( 'tl_metamodel_translatedurl' ) ) ) { return ; } foreach ( $ this -> database -> listFields ( 'tl_metamodel_translatedurl' , true ) as $ field ) { if ( 'href' == $ field [ 'name' ] && $ field [ 'type' ] != 'index' ) { if ( 'NOT ... | Ensure the default value for the href column is correct . |
239,416 | public function uncamelize ( $ input ) { $ input = trim ( $ input ) ; if ( empty ( $ input ) ) { throw new \ Exception ( "Can not uncamelize an empty string." ) ; } $ output = '' ; for ( $ i = 0 ; $ i < mb_strlen ( $ input ) ; ++ $ i ) { $ character = mb_substr ( $ input , $ i , 1 ) ; $ isCapital = ( $ character == mb_... | Uncamelize a string |
239,417 | function setExpiresIn ( $ expiry ) { $ this -> expiresIn = $ expiry ; $ this -> datetimeExpiration = $ this -> getDateTimeExpiration ( ) ; return $ this ; } | Set Expiry DateTime |
239,418 | static public function loadEmpty ( $ defaults = NULL ) { $ defaults = array_merge ( array ( 'FN' => '' , ) , ( array ) $ defaults ) ; $ ical = implode ( "\n" , array ( 'BEGIN:VCARD' , 'VERSION:3.0' , 'PRODID:QuipContact' , 'N:' , 'FN:' . QuipContactVcfFormatter :: escape ( $ defaults [ 'FN' ] ) , 'END:VCARD' , ) ) ; re... | Initialize an empty contact . |
239,419 | public function getUpdated ( ) { $ set = new ArrayList ( ) ; foreach ( $ this -> updated as $ arrItem ) { $ set -> push ( ArrayData :: create ( $ arrItem ) ) ; } return $ set ; } | Return all updated objects |
239,420 | public function getDeleted ( ) { $ set = new ArrayList ( ) ; foreach ( $ this -> deleted as $ arrItem ) { $ set -> push ( ArrayData :: create ( $ arrItem ) ) ; } return $ set ; } | Return all deleted objects |
239,421 | public function getData ( ) { $ data = new ArrayList ( ) ; if ( $ this -> CreatedCount ( ) ) { $ data -> push ( ArrayData :: create ( array ( "Title" => _t ( 'Consumer.CREATED' , 'Created' ) ) ) ) ; $ data -> merge ( $ this -> getCreated ( ) ) ; } if ( $ this -> UpdatedCount ( ) ) { $ data -> push ( ArrayData :: create... | Prepare the boby for an email or build task |
239,422 | protected function getChangedFields ( $ obj ) { $ changedFields = $ obj -> getChangedFields ( true , 2 ) ; foreach ( $ changedFields as $ key => $ value ) { $ changedFields [ $ key ] [ 'before' ] = '(' . gettype ( $ value [ 'before' ] ) . ') ' . $ value [ 'before' ] ; $ changedFields [ $ key ] [ 'after' ] = '(' . getty... | Modelled on the getChangedFields of DataObject with the addition of the variable s type |
239,423 | public function directoryFiles ( $ path ) { $ contents = [ ] ; $ directoryFiles = scandir ( $ path ) ; foreach ( $ directoryFiles as $ index => $ filePath ) { if ( ! in_array ( $ filePath , [ '.' , '..' ] ) ) { if ( is_dir ( $ path . DIRECTORY_SEPARATOR . $ filePath ) ) { $ contents = array_merge ( $ contents , self ::... | Return an array of files with their full paths contained in a directory and its subdirectories |
239,424 | public static function simple ( Configuration $ configuration , VenueFactory $ venueFactory ) { return new static ( $ configuration , new HttpMethodsClient ( HttpClientDiscovery :: find ( ) , MessageFactoryDiscovery :: find ( ) ) , $ venueFactory ) ; } | Convenience factory method creating a standard Client configuration . |
239,425 | public function getVenue ( Identifier $ identifier ) { $ url = $ this -> getUrl ( sprintf ( 'venues/%s' , urlencode ( $ identifier ) ) ) ; $ response = $ this -> httpClient -> get ( $ url , $ this -> getDefaultHeaders ( ) ) ; $ content = $ this -> parseResponse ( $ response ) ; if ( ! isset ( $ content -> response -> v... | Get a venue by its unique identifier . |
239,426 | public function search ( Search $ options ) { $ url = $ this -> getUrl ( 'venues/search' , $ options -> parametrise ( ) ) ; $ response = $ this -> httpClient -> get ( $ url , $ this -> getDefaultHeaders ( ) ) ; $ content = $ this -> parseResponse ( $ response ) ; if ( ! isset ( $ content -> response -> venues ) ) { thr... | Search venues . |
239,427 | public function explore ( Explore $ options ) { $ url = $ this -> getUrl ( 'venues/explore' , $ options -> parametrise ( ) ) ; $ response = $ this -> httpClient -> get ( $ url , $ this -> getDefaultHeaders ( ) ) ; $ content = $ this -> parseResponse ( $ response ) ; if ( ! isset ( $ content -> response -> groups [ 0 ] ... | Explore venues . |
239,428 | private function parseResponse ( ResponseInterface $ response ) { if ( $ response -> getStatusCode ( ) >= 400 && $ response -> getStatusCode ( ) < 500 ) { throw new ClientErrorException ( $ response ) ; } if ( $ response -> getStatusCode ( ) >= 500 && $ response -> getStatusCode ( ) < 600 ) { throw new ServerErrorExcep... | Parse a response . |
239,429 | private function getUrl ( $ path , $ parameters = [ ] ) { $ url = sprintf ( '%s/v%d/%s?client_id=%s&client_secret=%s&v=%s%s' , $ this -> configuration -> getBasePath ( ) , urlencode ( $ this -> configuration -> getVersion ( ) ) , trim ( $ path , '/' ) , urlencode ( $ this -> configuration -> getClientId ( ) ) , urlenco... | Get the API url for a given path . |
239,430 | private function parseParameters ( array $ parameters ) { if ( empty ( $ parameters ) ) { return '' ; } $ parameters = implode ( '&' , array_map ( function ( $ value , $ key ) { return sprintf ( '%s=%s' , $ key , urlencode ( $ value ) ) ; } , $ parameters , array_keys ( $ parameters ) ) ) ; return "&{$parameters}" ; } | Parse an array of parameters to their string representation . |
239,431 | public static function bootRequired ( ) { if ( self :: isUnableToRunPlugins ( ) ) { return ; } foreach ( self :: $ required as $ plugin ) { require_once __DIR__ . DS . $ plugin ; } } | Load required plugins |
239,432 | public static function loadFromPath ( $ path ) { if ( self :: isUnableToRunPlugins ( ) ) { return ; } if ( ! file_exists ( $ path ) ) { throw new InvalidArgumentException ( "The path [{$path}] doesn't exist to load plugins." ) ; } $ plugins = require $ path ; foreach ( $ plugins as $ plugin ) { if ( array_key_exists ( ... | Require plugins based on an array of paths |
239,433 | protected function setTags ( $ key , array $ tags = [ ] ) { if ( empty ( $ tags ) ) { return ; } foreach ( $ this -> prepareTags ( $ tags ) as $ tag ) { if ( ( $ keys = $ this -> storage -> get ( $ tag ) ) !== false ) { $ keys = $ this -> unserialize ( $ keys ) ; if ( in_array ( $ key , $ keys , true ) ) { continue ; }... | Sets a tags |
239,434 | public function getByTaxonomy ( $ taxonomy ) { if ( ! ( $ taxonomy instanceof Taxonomy ) ) { $ taxonomy = $ this -> taxonomyFactory -> create ( $ taxonomy ) ; } return $ this -> convertTermsArray ( get_terms ( $ taxonomy -> getName ( ) , array ( 'hide_empty' => false ) ) , $ taxonomy ) ; } | Get all terms in the given taxonomy . |
239,435 | private function convertTermsArray ( $ terms , Taxonomy $ taxonomy ) { $ res = array ( ) ; foreach ( $ terms as $ t ) { $ res [ ] = $ this -> termFactory -> create ( $ t , $ taxonomy ) ; } return $ res ; } | Convert an array of Wordpress term objects to array of Term objects . |
239,436 | protected function checkSSHConnection ( $ server = null , $ ssh_config_file = null , $ verbose = false ) { $ server = $ server ? $ server : $ this -> hostNameForConfigFile ( ) ; $ ssh_config_file = $ ssh_config_file ? $ ssh_config_file : $ this -> sshConfigFile ( ) ; if ( $ verbose ) { $ this -> info ( "timeout 10 ssh ... | Check SSH connection . |
239,437 | protected function abortIfNoSSHConnection ( $ server = null ) { $ server = $ server ? $ server : $ this -> hostNameForConfigFile ( ) ; if ( ! $ this -> checkSSHConnection ( $ server ) ) { $ this -> error ( "SSH connection to server $server doesn't works. Please run php artisan publish:init or publish:ssh" ) ; die ( ) ;... | Abort if no SSH connection . |
239,438 | protected function _processKey ( $ config , $ key , $ value ) { if ( strpos ( $ key , $ this -> _nestSeparator ) !== false ) { $ parts = explode ( $ this -> _nestSeparator , $ key , 2 ) ; if ( strlen ( Arrays :: first ( $ parts ) ) && strlen ( Arrays :: last ( $ parts ) ) ) { if ( ! isset ( $ config [ Arrays :: first (... | Assign the key s value to the property list . Handles the nest separator for sub - properties . |
239,439 | public function assertParity ( ) : void { $ ignored_classes = [ ] ; $ object_exists = false ; $ actor_exists = false ; $ locator = new ClassFileLocator ( $ this -> folder ) ; foreach ( $ locator as $ file ) { $ filename = str_replace ( $ this -> folder . DIRECTORY_SEPARATOR , '' , $ file -> getRealPath ( ) ) ; foreach ... | Validates the compiled schema directory . |
239,440 | protected function checkEdgeDir ( string $ node_name ) : void { $ dirname = $ this -> folder . DIRECTORY_SEPARATOR . $ node_name . "Out" ; if ( ! file_exists ( $ dirname ) ) { throw new Exceptions \ AbsentEdgeDirImparityException ( $ dirname , $ node_name ) ; } } | Checks if the node has a directory for its edges . |
239,441 | public function optimize ( stdClass $ data ) { $ data -> translationFilePrefix = $ this -> stringWithUnderscore ( $ data -> serviceURL ) ; $ data -> translationFilePrefix = $ this -> stringWithUnderscore ( $ data -> translationFilePrefix ) ; $ data -> translationsLocation = $ this -> getTranslationPrefix ( $ data ) . $... | Optimizing Translations data |
239,442 | private function getServiceProviderNameSpace ( stdClass $ item ) { return json_decode ( file_get_contents ( $ item -> rootDirectory . 'app/' . HCNewService :: CONFIG_PATH ) ) -> general -> serviceProviderNameSpace ; } | Getting service provider namespace |
239,443 | public function generate ( stdClass $ service ) { $ this -> createFileFromTemplate ( [ "destination" => $ service -> rootDirectory . 'resources/lang/en/' . $ service -> translationFilePrefix . '.php' , "templateDestination" => __DIR__ . '/../templates/service/translations.hctpl' , "content" => [ "translations" => $ thi... | Creating translation file |
239,444 | private function gatherTranslations ( stdClass $ service ) { $ output = '' ; $ tpl = file_get_contents ( __DIR__ . '/../templates/shared/array.element.hctpl' ) ; $ line = str_replace ( '{key}' , 'page_title' , $ tpl ) ; $ line = str_replace ( '{value}' , $ service -> serviceName , $ line ) ; $ output .= $ line ; $ outp... | Gathering available translations |
239,445 | private function gatherTranslationsFromModel ( stdClass $ model , string $ tpl , array $ skip ) { $ output = '' ; if ( array_key_exists ( 'columns' , $ model ) && ! empty ( $ model -> columns ) ) foreach ( $ model -> columns as $ column ) { if ( in_array ( $ column -> Field , $ skip ) ) continue ; $ line = str_replace ... | Gathering fields from specific model |
239,446 | public function getQueryCacheDriver ( ) { if ( ! $ this -> queryCacheDriver instanceof CacheProvider ) { $ this -> queryCacheDriver = $ this -> getCacheDriver ( ( string ) $ this -> getOption ( 'query_cache_namespace' ) , $ this -> getOption ( 'query_cache_driver' ) ) ; } return $ this -> queryCacheDriver ; } | Retrieve query cache driver . |
239,447 | public function getResultCacheDriver ( ) { if ( ! $ this -> resultCacheDriver instanceof CacheProvider ) { $ this -> resultCacheDriver = $ this -> getCacheDriver ( ( string ) $ this -> getOption ( 'result_cache_namespace' ) , $ this -> getOption ( 'result_cache_driver' ) ) ; } return $ this -> resultCacheDriver ; } | Retrieve result cache driver . |
239,448 | public function getHydratorCacheDriver ( ) { if ( ! $ this -> hydratorCacheDriver instanceof CacheProvider ) { $ this -> hydratorCacheDriver = $ this -> getCacheDriver ( ( string ) $ this -> getOption ( 'hydrator_cache_namespace' ) , $ this -> getOption ( 'hydrator_cache_driver' ) ) ; } return $ this -> hydratorCacheDr... | Retrieve hydrator cache driver . |
239,449 | protected function getCacheDriver ( $ cacheNamespace , CacheProvider $ cacheDriver = null ) { if ( ! $ cacheDriver instanceof CacheProvider ) { $ cacheDriver = clone $ this -> getMetadataCacheDriver ( ) ; $ cacheDriver -> setNamespace ( $ cacheNamespace ) ; } if ( $ cacheDriver -> getNamespace ( ) === '' ) { $ cacheDri... | Get cache driver . |
239,450 | protected function getNamingStrategy ( ) { if ( ! $ this -> namingStrategy instanceof NamingStrategy ) { $ namingStrategy = $ this -> getOption ( 'naming_strategy' ) ; if ( ! $ namingStrategy instanceof NamingStrategy ) { $ namingStrategy = new UnderscoreNamingStrategy ( CASE_LOWER ) ; } $ this -> namingStrategy = $ na... | Retrieve naming strategy . |
239,451 | protected function getQuoteStrategy ( ) { if ( ! $ this -> quoteStrategy instanceof QuoteStrategy ) { $ quoteStrategy = $ this -> getOption ( 'quote_strategy' ) ; if ( ! $ quoteStrategy instanceof QuoteStrategy ) { $ quoteStrategy = new DefaultQuoteStrategy ; } $ this -> quoteStrategy = $ quoteStrategy ; } return $ thi... | Retrieve quote strategy . |
239,452 | protected function getSecondLevelCacheConfiguration ( ) { if ( ! $ this -> secondCacheConfig instanceof CacheConfiguration ) { $ secondCacheConfig = $ this -> getOption ( 'second_level_cache_configuration' ) ; if ( $ secondCacheConfig instanceof CacheConfiguration ) { $ this -> secondCacheConfig = $ secondCacheConfig ;... | Retrieve second level cache configuration . |
239,453 | protected function getSQLLogger ( ) { if ( ! $ this -> SQLLogger instanceof SQLLogger ) { $ sqlLogger = $ this -> getOption ( 'sql_logger' ) ; if ( $ sqlLogger instanceof SQLLogger ) { $ this -> SQLLogger = $ sqlLogger ; } } return $ this -> SQLLogger ; } | Retrieve SQL logger . |
239,454 | protected function getCustomStringFunctions ( ) { $ functions = ( array ) $ this -> getOption ( 'custom_string_functions' ) ; return array_filter ( $ functions , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; } | Retrieve custom DQL string functions . |
239,455 | protected function getCustomNumericFunctions ( ) { $ functions = ( array ) $ this -> getOption ( 'custom_numeric_functions' ) ; return array_filter ( $ functions , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; } | Retrieve custom DQL numeric functions . |
239,456 | protected function getCustomDateTimeFunctions ( ) { $ functions = ( array ) $ this -> getOption ( 'custom_datetime_functions' ) ; return array_filter ( $ functions , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; } | Retrieve custom DQL date time functions . |
239,457 | protected function getCustomTypes ( ) { $ types = ( array ) $ this -> getOption ( 'custom_types' ) ; return array_filter ( $ types , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; } | Retrieve custom DBAL types . |
239,458 | protected function getCustomMappingTypes ( ) { $ mappingTypes = ( array ) $ this -> getOption ( 'custom_mapping_types' ) ; return array_filter ( $ mappingTypes , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; } | Retrieve custom DBAL mapping types . |
239,459 | protected function getCustomFilters ( ) { $ filters = ( array ) $ this -> getOption ( 'custom_filters' ) ; return array_filter ( $ filters , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; } | Get custom registered filters . |
239,460 | protected function getConsoleHelperSet ( ) { $ entityManager = $ this -> getManager ( ) ; return new HelperSet ( [ 'db' => new ConnectionHelper ( $ entityManager -> getConnection ( ) ) , 'em' => new EntityManagerHelper ( $ entityManager ) , ] ) ; } | Get console helper set . |
239,461 | public function setSalt ( string $ salt , string $ position = self :: SALT_AFTER ) : self { $ this -> checkSaltPositionArgument ( $ position ) ; $ this -> salt = $ salt ; $ this -> saltPosition = $ position ; return $ this ; } | Sets the salt if any was used |
239,462 | protected function checkSaltPositionArgument ( $ position ) : void { if ( ! in_array ( $ position , [ self :: SALT_BEFORE , self :: SALT_AFTER ] ) ) { throw new InvalidArgumentException ( sprintf ( '`%s` is an invalud argument, it has to be `` or ``' , $ position , self :: SALT_BEFORE , self :: SALT_AFTER ) ) ; } } | Checks the salt position argument |
239,463 | public function queryBuilder ( ConnectionInterface $ connection , String $ connectionId = null ) : QueryBuilderProvider { return new PdoQueryBuilder ( $ connection , $ connectionId ) ; } | We re using pdo query builder . |
239,464 | protected function validateDestinationNameCopy ( ) { $ destination = $ this -> getSubmitted ( 'destination' ) ; if ( $ destination !== '' && preg_match ( '/^[\w-]+[\w-\/]*[\w-]+$|^[\w-]$/' , $ destination ) !== 1 ) { $ this -> setErrorInvalid ( 'destination' , $ this -> translation -> text ( 'Destination' ) ) ; } } | Validates a directory name |
239,465 | protected function validateDestinationDirectoryCopy ( ) { if ( $ this -> isError ( ) ) { return null ; } $ initial_path = $ this -> scanner -> getInitialPath ( true ) ; $ directory = gplcart_path_normalize ( "$initial_path/" . $ this -> getSubmitted ( 'destination' ) ) ; if ( ! file_exists ( $ directory ) && ! mkdir ( ... | Validates a destination directory |
239,466 | protected function validateDestinationExistanceCopy ( ) { if ( $ this -> isError ( ) ) { return null ; } $ destinations = array ( ) ; $ directory = $ this -> getSubmitted ( 'directory' ) ; $ error = null ; foreach ( ( array ) $ this -> getSubmitted ( 'files' ) as $ index => $ file ) { if ( $ file -> isDir ( ) && gplcar... | Validates file destinations |
239,467 | public function getGroupedApplications ( ) { $ organizations = $ this -> getEntityManager ( ) -> getRepository ( Organization :: class ) -> findAll ( ) ; $ applications = $ this -> findAll ( ) ; usort ( $ applications , $ this -> applicationSorter ( ) ) ; usort ( $ organizations , $ this -> organizationSorter ( ) ) ; $... | Get all applications sorted into organizations . |
239,468 | public function sendNotification ( $ scope , $ event , $ nid = null , $ theme = null , $ timestamp = null , $ uid = null ) { if ( $ this -> connector -> getURL ( ) === null ) { return 'Cannot find site URL from configuration.' ; } $ url = $ this -> connector -> getURL ( ) . self :: VERSION . '/notification' ; $ params ... | Send theme notification . |
239,469 | public function processModification ( $ siteGroupId = null ) { if ( $ this -> connector -> getURL ( ) === null ) { return 'Cannot find site URL from configuration.' ; } $ url = $ this -> connector -> getURL ( ) . self :: VERSION . '/process' ; $ params = [ 'sitegroup_id' => $ siteGroupId , ] ; $ response = $ this -> co... | Process theme modification . |
239,470 | public function setObjectPrototype ( $ objectPrototype ) { if ( ! is_object ( $ objectPrototype ) || ( ! $ objectPrototype instanceof ArrayObject && ! method_exists ( $ objectPrototype , 'exchangeArray' ) ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Object must be of type %s, or at least implement ... | Set the item object prototype |
239,471 | public function getConfiguredWriter ( $ fp , Configuration $ config = null ) { if ( ! $ config ) { $ config = $ this -> config ; } $ writerName = $ config -> getOption ( Configuration :: OPT_WRITER ) ; if ( ! $ writerName ) { throw new \ Exception ( 'Writer must be defined in config for getConfiguredWriter()' ) ; } $ w... | Get a writer configured using the default configuration or the one passed in . |
239,472 | public function getWriterByName ( $ fp , $ writerName ) { $ method = 'get' . $ writerName ; if ( method_exists ( $ this -> getWriterFactory ( ) , $ method ) ) { return $ this -> getWriterFactory ( ) -> $ method ( $ fp ) ; } else { throw new \ InvalidArgumentException ( 'writer not found: ' . $ writerName ) ; } } | Get a writer by it s name . The name is looked up in the writer factory prefixed with get . |
239,473 | public function editAction ( Image $ image , Request $ request ) { $ form = $ this -> container -> get ( 'form.factory' ) -> createNamed ( 'image' , ImageType :: class , $ image , array ( 'action' => $ this -> container -> get ( 'router' ) -> generate ( 'synapse_admin_image_edition' , array ( 'id' => $ image -> getId (... | Image edition action . |
239,474 | public function xhrFormatAction ( Image $ image , $ formatName , Request $ request ) { if ( ! $ format = $ this -> container -> get ( 'synapse.image_format.loader' ) -> retrieveOne ( array ( 'name' => $ formatName ) ) ) { return new JsonResponse ( array ( 'error' => 400 , 'error_message' => sprintf ( 'No format found w... | Image formating action through XmlHttpRequest . |
239,475 | public function renderJavascript ( FormView $ view , $ prototype = false ) { $ block = $ prototype ? 'js_prototype' : 'js' ; return $ this -> renderer -> searchAndRenderBlock ( $ view , $ block ) ; } | Render Function Form Javascript |
239,476 | public function confirmDestroy ( Message $ message ) { $ this -> authorize ( 'delete' , $ message ) ; return view ( 'laralum::pages.confirmation' , [ 'method' => 'DELETE' , 'message' => __ ( 'laralum_tickets::general.sure_del_message' , [ 'id' => $ message -> id ] ) , 'action' => route ( 'laralum::tickets.messages.dest... | View for cofirm delete message . |
239,477 | public function make ( $ key , $ params = [ ] ) { if ( $ this -> aliasExist ( $ key ) ) { return $ this -> make ( $ this -> aliases [ $ key ] , $ params ) ; } if ( is_callable ( $ key ) ) { return call_user_func_array ( $ key , $ this -> resolveCallback ( $ key , $ params ) ) ; } return $ this -> resolveClass ( $ key ,... | Resolved dependencies for a key . |
239,478 | public function need ( $ key ) { if ( ! isset ( $ this -> resolved [ $ key ] ) ) { return $ this -> make ( $ key ) ; } return $ this -> resolved [ $ key ] ; } | Get the resolved type for a key that already resolved by the container . If the key does not resolve at first resolved it then returns the resolved type . |
239,479 | public function bind ( $ key , $ value ) { if ( is_callable ( $ value ) ) { $ this -> aliases [ $ key ] = $ value ; } elseif ( is_object ( $ value ) ) { $ this -> resolved [ $ key ] = $ value ; } else { if ( class_exists ( $ value ) ) $ this -> aliases [ $ key ] = $ value ; else throw new Exception ( "Class [ $value ] ... | Bind a value for a key . |
239,480 | public function resolveCallback ( Closure $ callback , $ params = [ ] ) { $ reflectionParameter = new ReflectionFunction ( $ callback ) ; $ dependencies = $ reflectionParameter -> getParameters ( ) ; return $ this -> getDependencies ( $ dependencies , $ params ) ; } | Resolve dependencies for a callback . |
239,481 | public function resolveMethod ( $ class , $ method , $ params = [ ] , $ isRoute = false ) { $ reflectionMethod = new ReflectionMethod ( $ class , $ method ) ; $ dependencies = $ reflectionMethod -> getParameters ( ) ; return $ this -> getDependencies ( $ dependencies , $ params , $ isRoute ) ; } | Resolve dependencies for a method . |
239,482 | public function resolveClass ( $ name , $ params = [ ] ) { $ reflectionClass = new ReflectionClass ( $ name ) ; if ( ! $ reflectionClass -> isInstantiable ( ) ) { throw new Exception ( "The [ {$name} ] is not instantiable." ) ; } $ constructor = $ reflectionClass -> getConstructor ( ) ; if ( ! is_null ( $ constructor )... | Resolve dependencies for a class . |
239,483 | protected function getDependencies ( $ dependencies , $ params = [ ] , $ isRoute = false ) { $ resolving = [ ] ; foreach ( $ dependencies as $ dependency ) { if ( $ dependency -> isDefaultValueAvailable ( ) ) { $ resolving = $ this -> getDependencyDefaultValue ( $ dependency , $ params , $ resolving , $ isRoute ) ; } e... | Get all required dependencies . |
239,484 | public function has ( $ key ) { if ( array_key_exists ( $ key , $ this -> aliases ) || array_key_exists ( $ key , $ this -> resolved ) ) { return true ; } else { return false ; } } | Check a key is already exists . |
239,485 | protected function getDependencyDefaultValue ( $ dependency , $ params , $ resolving , $ isRoute ) { if ( $ isRoute ) { if ( isset ( $ params [ $ dependency -> name ] ) ) { $ resolving [ ] = $ params [ $ dependency -> name ] ; } else { $ resolving [ ] = $ dependency -> getDefaultValue ( ) ; } return $ resolving ; } els... | Get dependency default value . |
239,486 | public function cell ( $ value , array $ attributes = null ) { $ cell = new self ; $ cell -> setValue ( $ value ) ; if ( null !== $ attributes ) { $ cell -> setAttributes ( $ attributes ) ; } return $ cell ; } | Generates a new table cell |
239,487 | protected function _getIterator ( ) { if ( is_null ( $ this -> iterator ) ) { $ this -> iterator = $ this -> _resolveIterator ( $ this -> _getDataStore ( ) ) ; } return $ this -> iterator ; } | Retrieves the iterator of this instance s data store . |
239,488 | public function fmap ( \ Closure $ trans ) { return $ this -> flightcontrol ( ) -> newFDirectory ( $ this , function ( ) use ( $ trans ) { return array_map ( $ trans , $ this -> fcontents ( ) ) ; } ) ; } | As this is as functor we could map over it . |
239,489 | public function fold ( $ start_value , $ iteration ) { return $ this -> outer_fmap ( function ( $ contents ) use ( $ start_value , $ iteration ) { $ value = $ start_value ; foreach ( $ contents as $ content ) { $ value = $ iteration ( $ value , $ content ) ; } return $ value ; } ) ; } | Define the function to be iterated with and close this level of iteration . |
239,490 | public function fcontents ( ) { if ( $ this -> contents === null ) { $ cl = $ this -> contents_lazy ; $ this -> contents = $ cl ( ) ; } return $ this -> contents ; } | The contents of this directory . |
239,491 | public function checkSession ( ) { $ session_token = isset ( $ _COOKIE [ $ this -> cookie_name ] ) ? $ _COOKIE [ $ this -> cookie_name ] : ( isset ( $ _SERVER [ 'HTTP_AUTH_TOKEN' ] ) ? $ _SERVER [ 'HTTP_AUTH_TOKEN' ] : null ) ; if ( $ session_token ) { $ session_id = ( array ) $ this -> session_machine_ref_prefix ; $ s... | Check session - read & update cookies setup session state machine and register callbacks . |
239,492 | public function consumerId ( ) { if ( isset ( $ this -> session -> data [ 'customer_id' ] ) === true ) { return $ this -> session -> data [ 'customer_id' ] ; } return null ; } | - > NEW |
239,493 | protected function defaultDomain ( ) { if ( $ suffix = $ this -> parser -> getDomainSuffix ( ) ) { return strtolower ( camel_case ( basename ( getcwd ( ) ) ) ) . '.' . $ suffix ; } return '' ; } | Default domain . |
239,494 | public function _init ( ) { parent :: _init ( ) ; if ( ! $ model = $ this -> _model ) { throw new ConfigException ( "`'model'` option needs to be defined." ) ; } $ behavior = $ this ; $ model :: applyFilter ( 'save' , function ( $ self , $ params , $ chain ) use ( $ behavior ) { if ( $ behavior -> invokeMethod ( '_befo... | Initializer function called by the constructor unless the constructor init flag is set to false . |
239,495 | protected function _scope ( $ entity ) { $ scope = [ ] ; foreach ( $ this -> _config [ 'scope' ] as $ key => $ value ) { if ( is_numeric ( $ key ) ) { if ( isset ( $ entity , $ value ) ) { $ scope [ $ value ] = $ entity -> $ value ; } else { $ message = "The `{$value}` scope in not present in the entity." ; throw new U... | Setting a scope to an entity node . |
239,496 | protected function _insertParent ( $ entity ) { extract ( $ this -> _config ) ; $ parent = $ this -> _getById ( $ entity -> $ parent ) ; if ( $ parent ) { $ r = $ parent -> $ right ; $ this -> _update ( $ r , '+' , 2 , $ this -> _scope ( $ entity ) ) ; $ entity -> set ( [ $ left => $ r , $ right => $ r + 1 ] ) ; } } | Insert a parent |
239,497 | protected function _deleteFromTree ( $ entity ) { extract ( $ this -> _config ) ; $ span = 1 ; if ( $ entity -> $ right - $ entity -> $ left !== 1 ) { $ span = $ entity -> $ right - $ entity -> $ left ; $ model :: remove ( [ $ parent => $ entity -> data ( $ model :: key ( ) ) ] ) ; } $ this -> _update ( $ entity -> $ r... | Delete from tree |
239,498 | protected function _update ( $ rght , $ dir = '+' , $ span = 2 , $ scp = [ ] ) { extract ( $ this -> _config ) ; $ model :: update ( [ $ right => ( object ) ( $ right . $ dir . $ span ) ] , [ $ right => [ '>=' => $ rght ] ] + $ scp ) ; $ model :: update ( [ $ left => ( object ) ( $ left . $ dir . $ span ) ] , [ $ left ... | Update node indices |
239,499 | protected function _updateBetween ( $ range , $ dir = '+' , $ span = 2 , $ scp = [ ] , $ data = [ ] ) { extract ( $ this -> _config ) ; $ model :: update ( [ $ right => ( object ) ( $ right . $ dir . $ span ) ] , [ $ right => [ '>=' => $ range [ 'floor' ] , '<=' => $ range [ 'ceiling' ] ] ] + $ scp ) ; $ model :: updat... | Update node indices between |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.