idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
237,700 | public function getTarget ( ) { if ( $ this -> to === NULL && $ this -> options | self :: TYPE_IMPLEMENTATION ) { return $ this -> typeName ; } return $ this -> to ; } | Get the target of this binding eighter a string or a closure . |
237,701 | public function getMarkers ( $ marker = NULL ) { if ( $ marker !== NULL && $ this -> markers !== NULL ) { $ result = [ ] ; foreach ( $ this -> markers as $ check ) { if ( $ check instanceof $ marker ) { $ result [ ] = $ check ; } } return $ result ; } return ( array ) $ this -> markers ; } | Get all markers being set for this binding . |
237,702 | public function toAlias ( $ typeName ) { $ this -> options = self :: TYPE_ALIAS ; $ this -> to = ( string ) $ typeName ; return $ this ; } | Bind to another binding specified by name . |
237,703 | public function scoped ( Scope $ scope ) { if ( $ scope instanceof Dependent ) { $ this -> scope = NULL ; } else { $ this -> scope = get_class ( $ scope ) ; } return $ this ; } | Set the scope of the binding according to the binary value of the scope . |
237,704 | public function isMarked ( $ marker ) { if ( empty ( $ this -> markers ) ) { return false ; } if ( $ marker instanceof \ ReflectionClass ) { foreach ( $ this -> markers as $ check ) { if ( $ marker -> isInstance ( $ check ) ) { return true ; } } } elseif ( $ marker instanceof Marker ) { foreach ( $ this -> markers as $... | Check if the binding has a marker of the given type . |
237,705 | public function decorate ( \ Closure $ decorator , $ priority = 0 ) { $ this -> decorators -> insert ( $ decorator , $ priority ) ; return $ this ; } | Register a decorator with this binding . |
237,706 | public function getInitializers ( ) { $ initializers = $ this -> initializers ; foreach ( clone $ this -> decorators as $ decorator ) { $ initializers [ ] = $ decorator ; } return $ initializers ; } | Get all custom initializers of this binding . |
237,707 | public static function loadAverage ( ) { $ load = 0 ; if ( stristr ( PHP_OS , 'win' ) ) { $ cmd = "wmic cpu get loadpercentage /all" ; @ exec ( $ cmd , $ output ) ; if ( $ output ) { foreach ( $ output as $ line ) { if ( $ line && preg_match ( "/^[0-9]+\$/" , $ line ) ) { $ load = $ line ; break ; } } } } else { $ sys_... | Get load average in percents . |
237,708 | protected function getLocalizedFileReference ( string $ table , string $ field ) { if ( $ this -> getSysLanguageUid ( ) > 0 ) { $ localizedFileReferences = $ this -> getLocalizedFileReferences ( $ table , $ field ) ; if ( ! empty ( $ localizedFileReferences ) ) { $ localizedFileObject = $ localizedFileReferences [ 0 ] ... | Gets a localized file reference . |
237,709 | protected function getLocalizedFileReferences ( string $ table , string $ field ) { if ( $ this -> getSysLanguageUid ( ) > 0 ) { return $ this -> fileRepository -> findByRelation ( $ table , $ field , $ this -> getLocalizedUid ( ) ) ; } return null ; } | Gets localized file references . |
237,710 | protected function printp ( $ input , $ indent = 0 ) { $ input = trim ( $ input , "\n\t\r " ) ; $ indentation = str_repeat ( ' ' , $ indent ) ; $ this -> cli -> printf ( $ indentation . wordwrap ( str_replace ( "\n" , "\n$indentation" , $ input ) , 75 - $ indent , "\n$indentation" ) . "\n" ) ; } | Print paragraph . Anything passed will be trimmed and printed so as to fit in the limit of 75 characters per line . |
237,711 | private function createNewPost ( ) { if ( ! $ this -> user -> role -> hasPermission ( 'create' ) ) throw new CHttpException ( 403 , Yii :: t ( 'Api.content' , 'You do not have permission to create new entries.' ) ) ; $ model = new Content ; $ model -> populate ( $ _POST ) ; if ( $ model -> savePrototype ( $ this -> use... | Creates a new entry |
237,712 | private function updatePost ( $ id ) { $ model = $ this -> loadModel ( $ id ) ; if ( ! $ this -> user -> role -> hasPermission ( 'modify' ) ) throw new CHttpException ( 403 , Yii :: t ( 'Api.content' , 'You do not have permission to create new entries.' ) ) ; if ( $ this -> user -> role -> isA ( 'author' ) || $ this ->... | Updates an existing entry |
237,713 | private function loadModel ( $ id = NULL ) { if ( $ id === NULL ) throw new CHttpException ( 400 , Yii :: t ( 'Api.content' , 'Missing id' ) ) ; $ model = Content :: model ( ) -> findByPk ( $ id ) ; if ( $ model === NULL ) throw new CHttpException ( 404 , Yii :: t ( 'Api.content' , 'An entry with the id of {{id}} was n... | Retrieves the model |
237,714 | public function actionUploadImagePost ( $ id = NULL , $ promote = 0 ) { $ result = new CiiFileUpload ( $ id , $ promote ) ; return $ result -> uploadFile ( ) ; } | Uploads a video to the site . |
237,715 | public function transform ( $ array ) { if ( null === $ array ) { return '' ; } if ( ! is_array ( $ array ) ) { throw new TransformationFailedException ( 'Expected an array.' ) ; } foreach ( $ array as & $ value ) { $ value = sprintf ( '%s%s%s' , str_repeat ( ' ' , $ this -> paddingLeft ) , $ value , str_repeat ( ' ' ,... | Transforms an array into a delimited string |
237,716 | public function reverseTransform ( $ string ) { if ( null !== $ string && ! is_string ( $ string ) ) { throw new TransformationFailedException ( 'Expected a string.' ) ; } $ string = trim ( $ string ) ; if ( empty ( $ string ) ) { return array ( ) ; } $ values = explode ( $ this -> delimiter , $ string ) ; if ( 0 === c... | Transforms a delimited string into an array |
237,717 | public function getPermission ( $ code ) { if ( ! isset ( $ this -> permissions [ $ code ] ) ) { throw new Exceptions \ PermissionNotDefinedException ( $ this , $ code ) ; } return $ this -> permissions [ $ code ] ; } | Retrieve a permission name given code . |
237,718 | private function getObjectPropertiesValues ( $ object ) { $ properties = Core :: get ( ) -> getGettablePropertiesOfObject ( $ object ) ; $ finalProperties = [ ] ; foreach ( $ properties as $ property ) { $ finalProperties [ $ property ] = Core :: get ( ) -> getObjectService ( ) -> getObjectProperty ( $ object , $ prope... | Will return all the accessible properties of the given object instance . |
237,719 | protected function invokeStandardCommands ( ) { return $ this -> addCommand ( 'help' , __NAMESPACE__ . '\\Command\\Help' , 'Show this help' ) -> addCommand ( 'list' , __NAMESPACE__ . '\\Command\\ListCommands' , 'List all commands' ) -> addCommand ( 'init' , __NAMESPACE__ . '\\Command\\Init' , 'Create/update user-define... | Invoke standard commands |
237,720 | protected function invokeStandardOptions ( ) { return $ this -> addOption ( 'c' , 'config' , self :: OPTION_NOT_REQUIRED ) -> addOption ( 'h' , 'help' , self :: NO_VALUE ) -> addOption ( null , 'no-colors' , self :: NO_VALUE ) -> addOption ( 'q' , 'quiet' , self :: NO_VALUE ) -> addOption ( 'v' , 'verbose' , self :: NO... | Invoke standard options |
237,721 | protected function invokeLogging ( ) { $ this -> config [ 'log' ] = [ 'colorize' => true , 'verbosity' => Log :: ALL | ~ Log :: DEBUG ] ; $ this -> log = new Log ( ) ; return $ this ; } | Initialize logger with default values |
237,722 | public function addConfigFile ( $ file , $ force = false ) { $ settings = JSONFile :: read ( $ file , $ force ) ; $ this -> addConfigSettings ( $ settings ) ; return $ this ; } | Parse a JSON file and add its content to the configuration settings |
237,723 | public function addConfigSettings ( array $ settings ) { $ this -> config = $ this -> arrayMergeRecursiveOverwrite ( $ this -> config , $ settings ) ; return $ this ; } | Add configuration settings |
237,724 | protected function satisfyUserChoice ( ) { if ( array_key_exists ( 'version' , $ this -> config [ 'options' ] ) ) { $ this -> executeCommand ( 'version' ) ; $ this -> close ( ) ; } if ( count ( $ this -> config [ 'args' ] ) === 2 && array_key_exists ( 'v' , $ this -> config [ 'options' ] ) ) { $ this -> executeCommand ... | Try to find out what the user wants |
237,725 | protected function parseArguments ( ) { $ this -> config [ 'arguments' ] = [ ] ; $ commandFound = false ; for ( $ index = 0 ; $ index < count ( $ this -> config [ 'args' ] ) ; $ index ++ ) { if ( $ index === 0 ) { continue ; } $ arg = $ this -> config [ 'args' ] [ $ index ] ; if ( array_key_exists ( $ arg , $ this -> c... | Parse given arguments |
237,726 | protected function loadAdditionalConfigFiles ( ) { $ additionalConfigFiles = [ ] ; foreach ( $ this -> config [ 'options' ] as $ option => $ value ) { if ( in_array ( $ option , [ 'c' , 'config' ] ) ) { switch ( gettype ( $ value ) ) { case 'string' : $ additionalConfigFiles [ ] = $ value ; break ; case 'array' : forea... | Parse additional configuration files given as options |
237,727 | protected function addRuntimeSettings ( ) { $ newSettings = [ ] ; foreach ( $ this -> config [ 'options' ] as $ option => $ value ) { if ( in_array ( $ option , [ 's' , 'setting' ] ) ) { switch ( gettype ( $ value ) ) { case 'string' : $ newSettings [ ] = $ value ; break ; case 'array' : foreach ( $ value as $ item ) {... | Look for additional configuration settings given as options |
237,728 | protected function buildSettings ( $ keys , $ value ) { $ result = [ ] ; $ index = array_shift ( $ keys ) ; if ( ! isset ( $ keys [ 0 ] ) ) { $ result [ $ index ] = $ value ; } else { $ result [ $ index ] = $ this -> buildSettings ( $ keys , $ value ) ; } return $ result ; } | Create associative array for settings |
237,729 | protected function configureLogger ( ) { $ appNoColor = strtoupper ( $ this -> config [ 'composer' ] [ 'extra' ] [ 'name' ] ) . '_NOCOLOR' ; if ( array_key_exists ( 'no-colors' , $ this -> config [ 'options' ] ) || getenv ( 'NO_COLOR' ) !== false || getenv ( $ appNoColor ) !== false || ( function_exists ( 'posix_isatty... | Set color handling and verbosity for used logger |
237,730 | protected function loadComposerFile ( ) { $ composerFile = $ this -> config [ 'appDir' ] . '/composer.json' ; if ( ! is_readable ( $ composerFile ) ) { throw new Exception ( sprintf ( 'Composer file "%s" is missing or not readable' , $ composerFile ) , ExitApp :: RUNTIME_ERROR ) ; } $ this -> config [ 'composer' ] = JS... | Parse composer . json |
237,731 | public function sayWelcome ( OutputInterface $ output ) { $ breakline = '' ; $ output = $ this -> createBlockTitle ( $ output ) ; $ title = $ this -> formatAsTitle ( 'RCHCapistranoBundle - Continuous Deployment' ) ; $ welcome = array ( $ breakline , $ title , $ breakline , 'This bundle provides continuous deployment fo... | Writes stylized welcome message in Output . |
237,732 | protected function formatAsTitle ( $ content ) { $ formatter = $ this -> getHelper ( 'formatter' ) ; $ title = $ formatter -> formatBlock ( $ content , 'title' , true ) ; return $ title ; } | Formats string as output block title . |
237,733 | public function show ( $ menu = null , $ model = null ) { return Redirect :: route ( 'admin.menus.menulinks.edit' , [ $ menu -> id , $ model -> id ] ) ; } | Show resource . |
237,734 | public function indexAction ( ) { $ extractedDoc = $ this -> get ( 'kreta_simple_api_doc.extractor.api_doc_extractor' ) -> all ( ) ; $ htmlContent = $ this -> get ( 'nelmio_api_doc.formatter.html_formatter' ) -> format ( $ extractedDoc ) ; return new Response ( $ htmlContent , 200 , [ 'Content-Type' => 'text/html' ] ) ... | The index action . |
237,735 | public function register ( $ method , $ path , $ action , $ filter = null ) { if ( strncmp ( $ path , '/' , 1 ) !== 0 ) { $ path = '/' . $ path ; } $ path = $ this -> app -> config ( 'url.root' ) . $ path ; $ params = [ ] ; $ matches = [ ] ; $ method = strtolower ( $ method ) ; if ( preg_match_all ( '/\{([\w-\.]+)\}/i'... | Register a url |
237,736 | public function routes ( $ method = null ) { if ( $ method && isset ( $ this -> methods [ $ method ] ) ) { return $ this -> routes [ $ method ] ; } return $ this -> routes ; } | Retrieve registered routes |
237,737 | public function getAction ( $ url ) { $ current = false ; $ method = $ this -> app -> request -> method ( ) ? : 'GET' ; $ method = strtolower ( $ method ) ; foreach ( $ this -> routes [ $ method ] as $ route ) { $ matches = [ ] ; if ( preg_match ( $ route [ 'pattern' ] , $ url , $ matches ) ) { if ( ! empty ( $ matches... | Retrieve model and method to execute |
237,738 | public function resource ( $ route , $ controller , $ filter = null ) { $ this -> register ( 'get' , $ route , [ $ controller , 'index' ] , $ filter ) ; $ this -> register ( 'get' , $ route . '/{id}' , [ $ controller , 'show' ] , $ filter ) ; $ this -> register ( 'post' , $ route , [ $ controller , 'store' ] , $ filter... | Register a resource |
237,739 | public function getFilter ( $ filterName = null ) { return isset ( $ this -> filters [ $ filterName ] ) ? $ this -> filters [ $ filterName ] : false ; } | Returns a route filter |
237,740 | public function performFilter ( $ filter ) { $ filter = $ this -> getFilter ( $ filter ) ; if ( ! $ filter ) { throw new \ Exception ( 'Filter not found' , 500 ) ; } if ( $ filter instanceof \ Closure ) { call_user_func ( $ filter ) ; return $ this -> setAppliedFilter ( $ filter ) ; } if ( is_array ( $ filter ) ) { lis... | Performs a filter |
237,741 | public function group ( ) { if ( func_num_args ( ) === 2 ) { list ( $ prefix , $ routes ) = func_get_args ( ) ; $ filter = null ; } elseif ( func_num_args ( ) === 3 ) { list ( $ filter , $ prefix , $ routes ) = func_get_args ( ) ; } if ( strncmp ( $ prefix , '/' , 1 ) !== 0 ) { $ prefix = '/' . $ prefix ; } if ( substr... | Register a group of routers with a common filter |
237,742 | public static function get ( $ name = 'default' ) { if ( ! isset ( self :: $ connections [ $ name ] ) ) { return null ; } $ connector = self :: $ connections [ $ name ] ; return $ connector -> connection ( ) ; } | Get a PDO - Connection |
237,743 | public function getCategoriesTree ( $ limit = 1000 , $ orderBy = 'hierarchy' , $ orderDir = 'asc' ) { return $ this -> dataset -> getResult ( 'tree' , [ 'limit' => $ limit , 'order_by' => $ orderBy , 'order_dir' => $ orderDir ] ) ; } | Returns categories tree |
237,744 | public static function getColoredString ( $ string , $ foreground_color = '' , $ background_color = '' ) { $ colored_string = '' ; if ( isset ( static :: $ foreground_colors [ $ foreground_color ] ) ) { $ colored_string .= "\033[" . static :: $ foreground_colors [ $ foreground_color ] . 'm' ; } if ( isset ( static :: $... | Returns colored string . |
237,745 | public function getDeviceType ( ) { $ device = $ this -> session -> get ( 'device' ) ; if ( empty ( $ device ) ) { $ detector = $ this -> getLibrary ( ) ; if ( $ detector -> isMobile ( ) ) { $ device = 'mobile' ; } else if ( $ detector -> isTablet ( ) ) { $ device = 'tablet' ; } else { $ device = 'desktop' ; } $ this -... | Returns a device type |
237,746 | protected function switchTheme ( Controller $ controller ) { if ( ! $ controller -> isInternalRoute ( ) ) { try { $ device = $ this -> getDeviceType ( ) ; $ store_id = $ controller -> getStoreId ( ) ; $ settings = $ this -> module -> getSettings ( 'device' ) ; if ( ! $ controller -> isBackend ( ) && $ device !== 'deskt... | Switch the current theme |
237,747 | public function sendEmailToSuperAdmins ( $ subject , $ event , $ emailBladeFile ) { $ superAdminEmails = config ( 'auth_frontend_registration_successful_admins_who_receive_notification_email' ) ; if ( count ( $ superAdminEmails ) == 0 ) { $ superAdminEmails [ ] = config ( 'lasallecmsusermanagement.administrator_first_a... | Send email notifications to the super admins |
237,748 | public function isSuperAdministrator ( $ email ) { $ userId = $ this -> findUserIdByEmail ( $ email ) ; if ( $ userId == 0 ) { return ; } if ( $ this -> isUserSuperAdministrator ( $ userId ) ) { return true ; } return false ; } | Does this email belong to a super administrator? |
237,749 | public function findUserIdByEmail ( $ email ) { $ userId = DB :: table ( 'users' ) -> where ( 'email' , $ email ) -> value ( 'id' ) ; if ( ! $ userId ) { return 0 ; } return $ userId ; } | Find the user s ID from their email address . |
237,750 | public function isUserSuperAdministrator ( $ userId ) { $ result = DB :: table ( 'user_group' ) -> where ( 'user_id' , $ userId ) -> where ( 'group_id' , 3 ) -> first ( ) ; if ( ! $ result ) { return false ; } return true ; } | Does the user belong to the Super Administrator user group? |
237,751 | public static function dbgTime ( $ s ) { if ( getenv ( 'DEBUG' ) == '1' ) { self :: printMessage ( '<' . Carbon :: now ( ) -> toTimeString ( ) . '> ' . self :: withCallsite ( $ s ) , 'comment' ) ; } } | Yellow text with current time |
237,752 | public static function nfoTime ( $ s ) { self :: printMessage ( '<' . Carbon :: now ( ) -> toTimeString ( ) . '> ' . self :: withCallsite ( $ s ) , 'info' ) ; } | Green text with current time |
237,753 | public static function errTime ( $ s ) { self :: printMessage ( '<' . Carbon :: now ( ) -> toTimeString ( ) . '> ' . self :: withCallsite ( $ s ) , 'error' ) ; } | White text on red background with current time |
237,754 | public function registerHandler ( $ handler , $ type = false ) { if ( ! is_object ( $ handler ) ) { throw new FilterExecutorException ( 'Handler must be an object.' ) ; } if ( $ type === false ) { $ type = $ this -> guessHandlerType ( $ handler ) ; if ( $ type === false ) { throw new FilterExecutorException ( 'Could no... | Registers specific filtration handler . |
237,755 | public function registerHandlers ( array $ handlers ) { foreach ( $ handlers as $ type => $ handler ) { if ( ! is_string ( $ type ) ) { $ type = $ this -> guessHandlerType ( $ handler ) ; } $ this -> registerHandler ( $ handler , $ type ) ; } return $ this ; } | Registers different filtration handlers . |
237,756 | protected function applyFilter ( FilterInterface $ filter , $ handler ) { if ( ! ( $ filter instanceof CustomApplyFilterInterface ) || ! is_callable ( $ filter -> getApplyFilterFunction ( ) ) ) { return $ filter -> applyFilter ( $ handler ) ; } return call_user_func ( $ filter -> getApplyFilterFunction ( ) , $ filter ,... | Applies filtration . If the filter has custom function for filtration applying than it will be used . |
237,757 | protected function guessHandlerType ( $ handler ) { if ( ! is_object ( $ handler ) ) { return false ; } foreach ( $ this -> availableHandlerTypes as $ type => $ classFQN ) { if ( $ handler instanceof $ classFQN ) { return $ type ; } } return false ; } | Guesses handler type by handler object class FQN . Basically it checks if the handler class name exists in the available handler types . |
237,758 | protected function getPluginClassByName ( $ name ) { if ( array_key_exists ( $ name , $ this -> plugins ) === false ) { return false ; } return $ this -> plugins [ $ name ] ; } | Returns the class name for the given name |
237,759 | protected function getPlugin ( $ name , callable $ constructClosure = null ) { static $ cache = array ( ) ; if ( array_key_exists ( $ name , $ cache ) === true ) { return $ cache [ $ name ] ; } $ class = $ this -> getPluginClassByName ( $ name ) ; if ( $ class === false ) { throw new Exception \ PluginNotFound ( "Plugi... | Method for fetching a singleton instance of a plugin |
237,760 | protected function readTypeFromJsonFileUniversal ( $ filePath , $ fileBaseName ) { $ fName = $ filePath . DIRECTORY_SEPARATOR . $ fileBaseName . '.min.json' ; $ fJson = fopen ( $ fName , 'r' ) ; $ jSonContent = fread ( $ fJson , filesize ( $ fName ) ) ; fclose ( $ fJson ) ; return json_decode ( $ jSonContent , true ) ;... | returns an array with non - standard holidays from a JSON file |
237,761 | public function setHolidays ( \ DateTime $ lngDate , $ inclCatholicEaster = false , $ inclWorkingHolidays = false ) { $ givenYear = $ lngDate -> format ( 'Y' ) ; $ daying = array_merge ( $ this -> setHolidaysOrthodoxEaster ( $ lngDate ) , $ this -> setHolidaysFixed ( $ lngDate ) ) ; if ( $ inclWorkingHolidays ) { $ day... | List of legal holidays |
237,762 | private function setHolidaysOrthodoxEaster ( \ DateTime $ lngDate ) { $ givenYear = $ lngDate -> format ( 'Y' ) ; $ daying = [ ] ; $ configPath = __DIR__ . DIRECTORY_SEPARATOR . 'json' ; $ statmentsArray = $ this -> readTypeFromJsonFileUniversal ( $ configPath , 'RomanianBankHolidays' ) ; if ( array_key_exists ( $ give... | List of all Orthodox holidays and Pentecost |
237,763 | public function setHolidaysInMonth ( \ DateTime $ lngDate , $ inclCatholicEaster = false ) { $ holidaysInGivenYear = $ this -> setHolidays ( $ lngDate , $ inclCatholicEaster ) ; $ thisMonthDayArray = $ this -> setMonthAllDaysIntoArray ( $ lngDate ) ; $ holidays = 0 ; foreach ( $ thisMonthDayArray as $ value ) { if ( in... | returns bank holidays in a given month |
237,764 | protected function setMonthAllDaysIntoArray ( \ DateTime $ lngDate ) { $ firstDayGivenMonth = strtotime ( $ lngDate -> modify ( 'first day of this month' ) -> format ( 'Y-m-d' ) ) ; $ lastDayInGivenMonth = strtotime ( $ lngDate -> modify ( 'last day of this month' ) -> format ( 'Y-m-d' ) ) ; $ secondsInOneDay = 24 * 60... | return an array with all days within a month from a given date |
237,765 | public function setWorkingDaysInMonth ( \ DateTime $ lngDate , $ inclCatholicEaster = false ) { $ holidaysInGivenYear = $ this -> setHolidays ( $ lngDate , $ inclCatholicEaster ) ; $ thisMonthDayArray = $ this -> setMonthAllDaysIntoArray ( $ lngDate ) ; $ workingDays = 0 ; foreach ( $ thisMonthDayArray as $ value ) { i... | returns working days in a given month |
237,766 | public function setDataCache ( \ TYPO3 \ CMS \ Core \ Cache \ Frontend \ VariableFrontend $ dataCache ) { $ this -> dataCache = $ dataCache ; } | Sets the data cache . |
237,767 | public function initialize ( ) { if ( $ this -> initialized ) { throw new Exception ( 'The Reflection Service can only be initialized once.' , 1232044696 ) ; } $ frameworkConfiguration = $ this -> configurationManager -> getConfiguration ( \ TYPO3 \ CMS \ Extbase \ Configuration \ ConfigurationManagerInterface :: CONFI... | Initializes this service |
237,768 | public function getClassTagsValues ( $ className ) { if ( ! isset ( $ this -> reflectedClassNames [ $ className ] ) ) { $ this -> reflectClass ( $ className ) ; } if ( ! isset ( $ this -> classTagsValues [ $ className ] ) ) { return [ ] ; } return isset ( $ this -> classTagsValues [ $ className ] ) ? $ this -> classTag... | Returns all tags and their values the specified class is tagged with |
237,769 | public function getClassTagValues ( $ className , $ tag ) { if ( ! isset ( $ this -> reflectedClassNames [ $ className ] ) ) { $ this -> reflectClass ( $ className ) ; } if ( ! isset ( $ this -> classTagsValues [ $ className ] ) ) { return [ ] ; } return isset ( $ this -> classTagsValues [ $ className ] [ $ tag ] ) ? $... | Returns the values of the specified class tag |
237,770 | public function isClassTaggedWith ( $ className , $ tag ) { if ( $ this -> initialized === false ) { return false ; } if ( ! isset ( $ this -> reflectedClassNames [ $ className ] ) ) { $ this -> reflectClass ( $ className ) ; } if ( ! isset ( $ this -> classTagsValues [ $ className ] ) ) { return false ; } return isset... | Tells if the specified class is tagged with the given tag |
237,771 | protected function getMethodReflection ( $ className , $ methodName ) { $ this -> dataCacheNeedsUpdate = true ; if ( ! isset ( $ this -> methodReflections [ $ className ] [ $ methodName ] ) ) { $ this -> methodReflections [ $ className ] [ $ methodName ] = new MethodReflection ( $ className , $ methodName ) ; } return ... | Returns the Reflection of a method . |
237,772 | protected function loadFromCache ( ) { $ data = $ this -> dataCache -> get ( $ this -> cacheIdentifier ) ; if ( $ data !== false ) { foreach ( $ data as $ propertyName => $ propertyValue ) { $ this -> { $ propertyName } = $ propertyValue ; } } } | Tries to load the reflection data from this service s cache . |
237,773 | protected function saveToCache ( ) { if ( ! is_object ( $ this -> dataCache ) ) { throw new Exception ( 'A cache must be injected before initializing the Reflection Service.' , 1232044697 ) ; } $ data = [ ] ; $ propertyNames = [ 'reflectedClassNames' , 'classPropertyNames' , 'classMethodNames' , 'classTagsValues' , 'me... | Exports the internal reflection data into the ReflectionData cache . |
237,774 | public function addListener ( $ event , $ method ) { if ( ! isset ( $ this -> listeners [ $ event ] ) ) { $ this -> listeners [ $ event ] = array ( ) ; } $ this -> listeners [ $ event ] [ ] = $ method ; } | Adds a listener for the specified event . |
237,775 | protected function addErrorToProperty ( string $ property , string $ key , string $ extensionName ) { $ errorMessage = LocalizationUtility :: translate ( $ key , $ extensionName ) ; $ error = $ this -> objectManager -> get ( Error :: class , $ errorMessage , time ( ) ) ; $ this -> result -> forProperty ( $ property ) -... | Adds an error to a property . |
237,776 | private function filterHrefWithPath ( $ matches ) { static $ script ; static $ observeRewrite ; static $ config ; static $ assetsPath ; if ( is_null ( $ config ) ) { $ application = Application :: getInstance ( ) ; $ config = $ application -> getConfig ( ) ; $ observeRewrite = $ application -> getRouter ( ) -> getServe... | callback to turn href shortcuts into site conform valid URLs tries to build a path reflecting the position of the page in a nested menu |
237,777 | private function filterHref ( $ matches ) { static $ script ; static $ observeRewrite ; if ( is_null ( $ script ) ) { $ script = trim ( Request :: createFromGlobals ( ) -> getScriptName ( ) , '/' ) ; } if ( is_null ( $ observeRewrite ) ) { $ observeRewrite = Application :: getInstance ( ) -> getRouter ( ) -> getServerS... | callback to turn href shortcuts into site conform valid URLs |
237,778 | public function optionLabelFilter ( $ value , $ objectName , $ fieldName ) { $ fieldConfiguration = $ this -> flexModel -> getField ( $ objectName , $ fieldName ) ; $ label = "" ; if ( is_array ( $ fieldConfiguration ) ) { if ( isset ( $ fieldConfiguration [ 'options' ] ) ) { if ( is_array ( $ value ) ) { foreach ( $ v... | Gets the option label based on the object and field name . |
237,779 | private function getLabelForValue ( $ fieldConfiguration , $ value ) { $ label = "" ; foreach ( $ fieldConfiguration [ 'options' ] as $ option ) { if ( $ option [ 'value' ] == $ value ) { $ label = $ option [ 'label' ] ; } } return $ label ; } | Gets the label for the set value . |
237,780 | public function fieldLabelFilter ( $ value , $ objectName , $ fieldName ) { $ fieldConfiguration = $ this -> flexModel -> getField ( $ objectName , $ fieldName ) ; $ label = "" ; if ( is_array ( $ fieldConfiguration ) ) { $ label = $ fieldConfiguration [ 'label' ] ; } return $ label ; } | Gets the field label based on the object and field name . |
237,781 | public function build ( $ type ) { if ( ! isset ( $ this -> types [ $ type ] ) ) { throw new \ Exception ( "Unknown request type." ) ; } return new $ this -> types [ $ type ] ( ) ; } | Builds the request object . |
237,782 | protected function processQuery ( Query $ query , $ context ) : Query { $ queryProperties = [ ] ; $ queryProperties [ 'table' ] = $ this -> processTable ( $ query -> table , $ context ) ; foreach ( $ query -> select as $ alias => $ select ) { $ queryProperties [ 'select' ] [ $ alias ] = $ this -> processSelect ( $ sele... | Processes a Query object . DOES NOT change the given query or it s components by the link but may return it . |
237,783 | protected function processTable ( $ table , $ context ) { if ( is_string ( $ table ) ) { return $ this -> processTableName ( $ table , $ context ) ; } else { return $ this -> processSubQuery ( $ table , $ context ) ; } } | Processes a table name or table subquery |
237,784 | protected function processSelect ( $ select , $ context ) { if ( $ select instanceof Aggregate ) { $ column = $ this -> processColumnOrSubQuery ( $ select -> column , $ context ) ; if ( $ column === $ select -> column ) { return $ select ; } else { return new Aggregate ( $ select -> function , $ column ) ; } } return $... | Processes a single select column . |
237,785 | protected function processColumnOrSubQuery ( $ column , $ context ) { if ( is_string ( $ column ) ) { return $ this -> processColumnName ( $ column , $ context ) ; } return $ this -> processSubQuery ( $ column , $ context ) ; } | Processes a column or subquery value . |
237,786 | protected function processSubQuery ( $ subQuery , $ context ) { if ( $ subQuery instanceof Query ) { return $ this -> processQuery ( $ subQuery , $ context ) ; } return $ subQuery ; } | Processes a subquery . Not - subquery values are just passed through . |
237,787 | protected function processInsert ( $ row , $ context ) { if ( $ row instanceof InsertFromSelect ) { return $ this -> processInsertFromSelect ( $ row , $ context ) ; } $ newRow = [ ] ; foreach ( $ row as $ column => $ value ) { $ column = $ this -> processColumnName ( $ column , $ context ) ; $ newRow [ $ column ] = $ t... | Processes a single insert statement . |
237,788 | protected function processInsertFromSelect ( InsertFromSelect $ row , $ context ) : InsertFromSelect { if ( $ row -> columns === null ) { $ columns = null ; } else { $ columns = [ ] ; foreach ( $ row -> columns as $ index => $ column ) { $ columns [ $ index ] = $ this -> processColumnName ( $ column , $ context ) ; } }... | Processes a single insert from select statement . |
237,789 | protected function processJoin ( Join $ join , $ context ) : Join { $ table = $ this -> processTable ( $ join -> table , $ context ) ; $ criteria = [ ] ; foreach ( $ join -> criteria as $ index => $ criterion ) { $ criteria [ $ index ] = $ this -> processCriterion ( $ criterion , $ context ) ; } if ( $ table === $ join... | Processes a single join . |
237,790 | protected function processOrder ( $ order , $ context ) { if ( $ order instanceof Order || $ order instanceof OrderByIsNull ) { $ column = $ this -> processColumnOrSubQuery ( $ order -> column , $ context ) ; if ( $ column === $ order -> column ) { return $ order ; } elseif ( $ order instanceof Order ) { return new Ord... | Processes a single order statement . |
237,791 | private function skip ( $ nav ) { if ( $ this -> excludeComments && $ nav -> getNodeType ( ) == XML_COMMENT_NODE ) { $ this -> commentsSkipped ++ ; } return ( $ this -> excludeComments && $ nav -> getNodeType ( ) == XML_COMMENT_NODE ) || ( $ this -> excludeWhitespace && $ nav -> IsWhitespaceNode ( ) ) ; } | Check whether to skip this node |
237,792 | public function get ( $ name = null , $ default = null ) { $ value = null ; if ( null === $ name ) { $ value = $ this -> data ; } elseif ( isset ( $ this -> data [ $ name ] ) ) { $ value = $ this -> data [ $ name ] ; } elseif ( null !== $ default ) { $ value = $ default ; } else { throw new \ Exception ( 'Key not found... | Get request data . |
237,793 | public function getRenderedParameter ( $ key , $ escaper = null ) { $ subject = $ this -> getParameter ( $ key ) ; preg_match_all ( '/{{([a-zA-Z0-9\.\-\_]+)}}/' , $ subject , $ matches ) ; $ parameterList = $ matches [ 1 ] ; foreach ( $ parameterList as $ parameterKey ) { $ val = $ this -> getParameter ( $ parameterKey... | used to transform a value in a parameter . |
237,794 | public function withDegree ( Integer $ degree , Number $ coeff ) : self { $ degrees = $ this -> degrees -> put ( $ degree -> value ( ) , new Degree ( $ degree , $ coeff ) ) ; return new self ( $ this -> intercept , ... $ degrees -> values ( ) ) ; } | Create a new polynom with this added degree |
237,795 | public function derived ( Number $ x , Number $ limit = null ) : Number { $ limit = $ limit ?? Tangent :: limit ( ) ; return divide ( subtract ( $ this ( add ( $ x , $ limit ) ) , $ this ( $ x ) ) , $ limit ) ; } | Compute the derived number of x |
237,796 | public function getGPIOPins ( ) { if ( true === in_array ( $ this -> revision , [ 'a01041' , 'a21041' , 'a22042' ] , true ) ) { return range ( 2 , 27 ) ; } if ( true === in_array ( $ this -> revision , [ 'a02082' , 'a22082' , 'a32082' ] , true ) ) { return range ( 2 , 27 ) ; } return [ 0 , 1 , 4 , 7 , 8 , 9 , 10 , 11 ,... | Get the valid GPIO pin map |
237,797 | public function getName ( ) { if ( false === isset ( self :: $ modelNameMap [ $ this -> revision ] ) ) { return 'unknown' ; } return self :: $ modelNameMap [ $ this -> revision ] ; } | Get the revision name |
237,798 | protected function createFactory ( ) { $ factory = Str :: studly ( class_basename ( $ this -> argument ( 'name' ) ) ) ; $ this -> call ( 'make:factory' , [ 'name' => "{$factory}Factory" , '--model' => $ this -> argument ( 'name' ) , ] ) ; } | Create a model factory for the model . |
237,799 | public function generateCode ( ) { $ this -> digits [ 0 ] = rand ( 0 , 9 ) ; $ this -> digits [ 1 ] = rand ( 0 , 9 ) ; $ this -> digits [ 2 ] = rand ( 0 , 9 ) ; $ this -> digits [ 3 ] = rand ( 0 , 9 ) ; $ this -> digits [ 4 ] = rand ( 0 , 9 ) ; $ this -> value = $ this -> digits [ 0 ] * 10000 + $ this -> digits [ 1 ] *... | generate captcha value |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.