idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
228,100 | public function asString ( ) : string { $ fractionDigits = $ this -> currency -> getDefaultFractionDigits ( ) ; $ wholePart = substr ( ( string ) $ this -> amount , 0 , - $ fractionDigits ) ? : '0' ; $ fractionalPart = str_pad ( substr ( ( string ) $ this -> amount , - $ fractionDigits ) , $ fractionDigits , '0' , STR_... | Returns the monetary value as string . |
228,101 | static private function getDriver ( ) { if ( self :: $ _driver != null ) return self :: $ _driver ; $ driver = Utils :: spare ( Config :: get ( 'cache.driver' ) , 'file' ) ; switch ( strtolower ( $ driver ) ) { case 'memcached' : self :: $ _driver = new \ Lollipop \ Cache \ MemcachedAdapter ( ) ; break ; case 'file' : ... | Get cache driver |
228,102 | private function setAttributes ( ClassMetadataInfo $ metadata , Metadata \ AttributeInterface $ entity ) { foreach ( $ metadata -> fieldMappings as $ fieldKey => $ mapping ) { if ( isset ( $ mapping [ 'id' ] ) ) { continue ; } if ( isset ( $ mapping [ 'reference' ] ) ) { continue ; } if ( isset ( $ mapping [ 'inherited... | Sets the entity attribute metadata from the Doctrine class metadata . |
228,103 | private function setRelationships ( ClassMetadataInfo $ metadata , Metadata \ EntityMetadata $ entity ) { $ allTypes = $ this -> getAllTypeNames ( ) ; foreach ( $ metadata -> fieldMappings as $ fieldKey => $ mapping ) { if ( ! isset ( $ mapping [ 'reference' ] ) ) { continue ; } if ( ! isset ( $ mapping [ 'targetDocume... | Sets the entity relationship metadata from the Doctrine class metadata . |
228,104 | private function getDataType ( $ doctrineType ) { $ map = $ this -> getDoctrineTypeMap ( ) ; if ( ! isset ( $ map [ $ doctrineType ] ) ) { throw new InvalidArgumentException ( sprintf ( 'The Doctrine type "%s" is currenty not implemented by the API.' , $ doctrineType ) ) ; } return $ map [ $ doctrineType ] ; } | Gets the Modlr field data type from a Doctrine data type . |
228,105 | private function isPolymorphicType ( ClassMetadataInfo $ metadata ) { return in_array ( $ metadata -> inheritanceType , $ this -> getPolymorphicTypes ( ) ) && null === $ metadata -> discriminatorValue ; } | Determines if a Doctrine object is polymorphic based on its class metadata . |
228,106 | private function getTipTransUnit ( $ locale , $ domain , $ identifier ) { $ storage = $ this -> get ( 'lexik_translation.translation_storage' ) ; try { $ transUnits = $ storage -> getTransUnitsByLocaleAndDomain ( $ locale , $ domain ) ; } catch ( QueryException $ e ) { throw new \ RuntimeException ( 'Tips database not ... | Retrieve a random tip from the Lexik translations . Increment view count . |
228,107 | public function indexAction ( Request $ request , $ domain , $ identifier ) { $ locale = substr ( $ request -> getLocale ( ) , 0 , 2 ) ; try { $ transUnit = $ this -> getTipTransUnit ( $ locale , $ domain , $ identifier ) ; $ translatedTip = $ transUnit -> getTranslation ( $ locale ) ; return $ this -> render ( 'Tamago... | Render tip page with style and JavaScript . |
228,108 | public function feedbackAction ( Request $ request , $ id , $ feedback , $ domain , $ identifier ) { $ locale = substr ( $ request -> getLocale ( ) , 0 , 2 ) ; $ om = $ this -> getObjectManager ( ) ; $ repository = $ om -> getRepository ( 'TamagoTipsManagerBundle:TamagoTransUnitMeta' ) ; $ tipMetaData = $ repository ->... | Record feedback for given tip and return a new tip div block to be rendered via jQuery . |
228,109 | public function statsAction ( ) { $ om = $ this -> getObjectManager ( ) ; $ repository = $ om -> getRepository ( 'TamagoTipsManagerBundle:TamagoTransUnitMeta' ) ; $ stats = $ repository -> stats ( ) ; return $ this -> render ( 'TamagoTipsManagerBundle:Default:stats.html.twig' , [ 'stats' => $ stats ] ) ; } | Render stats page . |
228,110 | public static function OperatorPlus ( $ val1 , $ val2 ) { if ( ! $ val1 instanceof ValueProxy ) { $ f = isset ( ValueProxy :: $ valueFactory [ Type :: FromValue ( $ val1 ) -> getTypeName ( ) ] ) ? ValueProxy :: $ valueFactory [ Type :: FromValue ( $ val1 ) -> getTypeName ( ) ] : null ; if ( is_null ( $ f ) ) return fal... | Equivalent of the + operator |
228,111 | public function doExport ( ) { $ this -> downloadCsvExport ( ) ; $ settings = $ this -> module -> getSettings ( 'export' ) ; if ( empty ( $ settings [ 'columns' ] ) ) { $ settings [ 'columns' ] = array_keys ( $ settings [ 'header' ] ) ; } $ this -> setData ( 'settings' , $ settings ) ; $ this -> setData ( 'columns' , $... | Route callback to display the export page |
228,112 | protected function validateFileExport ( ) { $ directory = gplcart_file_private_module ( 'export' ) ; if ( ! file_exists ( $ directory ) && ! mkdir ( $ directory , 0775 , true ) ) { $ this -> setError ( 'file' , $ this -> text ( 'Unable to create @name' , array ( '@name' => $ directory ) ) ) ; return false ; } $ date = ... | Validates destination directory and file |
228,113 | protected function setJobExport ( ) { $ submitted = $ this -> getSubmitted ( ) ; $ settings = $ this -> module -> getSettings ( 'export' ) ; $ settings [ 'columns' ] = $ submitted [ 'columns' ] ; $ settings [ 'options' ] = $ submitted [ 'options' ] ; $ this -> module -> setSettings ( 'export' , $ settings ) ; $ data = ... | Sets up export job |
228,114 | protected function downloadCsvExport ( ) { $ file = $ this -> getQuery ( 'download' ) ; if ( ! empty ( $ file ) ) { $ this -> download ( gplcart_string_decode ( $ file ) ) ; } } | Download a created CSV file |
228,115 | public function loadMetadataForClass ( \ ReflectionClass $ class ) { foreach ( $ this -> drivers as $ driver ) { if ( null !== $ metadata = $ driver -> loadMetadataForClass ( $ class ) ) { return $ metadata ; } } } | Gets class metadata for the given class name . |
228,116 | public function isTransient ( $ className ) { foreach ( $ this -> drivers as $ driver ) { if ( false !== $ driver -> isTransient ( $ className ) ) { return true ; } } return false ; } | Returns whether the class with the specified name should have its metadata loaded . |
228,117 | public function getFullDescription ( ) { return strtr ( $ this -> template , [ "{name}" => $ this -> getName ( ) , "{description}" => $ this -> getDescription ( ) , "{version}" => $ this -> getVersion ( ) , "{ascii}" => $ this -> getAscii ( ) ] ) ; } | Return a composed - version of nominal values |
228,118 | private function AddMailSubjectField ( ) { $ name = 'MailSubject' ; $ field = Input :: Text ( $ name , $ this -> changePassword -> GetMailSubject ( ) ) ; $ this -> AddField ( $ field ) ; $ this -> SetRequired ( $ name ) ; } | Adds the field for e - mail field label |
228,119 | public function getObjectProperty ( $ object , $ property ) { $ result = null ; try { $ result = ObjectAccess :: getProperty ( $ object , $ property ) ; } catch ( \ Exception $ exception ) { if ( false === $ exception instanceof SilentExceptionInterface ) { throw $ exception ; } } return $ result ; } | This function will try to get a given property for a given object . |
228,120 | public function isRegistered ( $ name ) { return array_key_exists ( $ name , $ this -> services ) || ( isset ( $ this -> serviceProviders [ $ name ] ) && $ this -> serviceProviders [ $ name ] instanceof ServiceProviderInterface ) ; } | Check if service is registered |
228,121 | public static function createFactory ( callable $ configureMockProvider = null ) { $ factory = new Factory ( ) ; $ provider = new MockProvider ( $ factory ) ; if ( $ configureMockProvider ) { $ configureMockProvider ( $ provider ) ; } $ factory -> setProvider ( 'StdClass' , $ provider ) ; return $ factory ; } | Creates a Factory with MockProvider set as default Provider |
228,122 | function getDownloadUrl ( ) { $ inputs = self :: remoteXpathQuery ( $ this -> videoUrl , '/html/body/div[3]/div[2]/div[2]/div[7]/form/input[@name]' ) ; $ postFields = [ ] ; foreach ( $ inputs as $ input ) { $ postFields [ $ input -> getAttribute ( 'name' ) ] = $ input -> getAttribute ( 'value' ) ; } sleep ( 11 ) ; $ sc... | Special provider implementation |
228,123 | public function selectExcept ( $ fields ) { $ fields = array_diff ( $ this -> getFields ( ) , is_array ( $ fields ) ? $ fields : [ $ fields ] ) ; return $ this -> select ( $ fields ) ; } | Specifies an item that is not to be returned in the query result . Replaces any previously specified selections if any . |
228,124 | public function load ( $ names ) { foreach ( ( array ) $ names as $ name ) { $ parts = explode ( '.' , $ name , 2 ) ; $ name = $ parts [ 0 ] ; $ next = isset ( $ parts [ 1 ] ) ? $ parts [ 1 ] : null ; if ( isset ( $ this -> loadedRelations [ $ name ] ) ) { continue ; } $ related = $ this -> $ name ( ) ; $ isColl = $ re... | Eager load relations |
228,125 | protected function snake ( $ input ) { if ( isset ( static :: $ snakeCache [ $ input ] ) ) { return static :: $ snakeCache [ $ input ] ; } $ value = $ input ; if ( ! ctype_lower ( $ input ) ) { $ value = strtolower ( preg_replace ( '/(?<!^)[A-Z]/' , '_$0' , $ input ) ) ; } return static :: $ snakeCache [ $ input ] = $ ... | Convert a input to snake case |
228,126 | protected function camel ( $ input ) { if ( isset ( static :: $ camelCache [ $ input ] ) ) { return static :: $ camelCache [ $ input ] ; } return static :: $ camelCache [ $ input ] = lcfirst ( str_replace ( ' ' , '' , ucwords ( strtr ( $ input , '_-' , ' ' ) ) ) ) ; } | Convert a input to camel case |
228,127 | public function hasColumn ( $ name ) { $ name = $ this -> filterInputColumn ( $ name ) ; return in_array ( $ name , $ this -> getFields ( ) ) ; } | Check if column name exists |
228,128 | public function isChanged ( $ field = null ) { if ( $ field ) { $ field = $ this -> filterInputColumn ( $ field ) ; return array_key_exists ( $ field , $ this -> changedData ) ; } return $ this -> isChanged ; } | Check if the record s data or specified field is changed |
228,129 | public function toRet ( array $ merge = [ ] ) { if ( $ this -> isColl ( ) ) { return $ this -> suc ( $ merge + [ 'data' => $ this , 'page' => $ this -> getSqlPart ( 'page' ) , 'rows' => $ this -> getSqlPart ( 'limit' ) , 'records' => $ this -> count ( ) , ] ) ; } else { return $ this -> suc ( $ merge + [ 'data' => $ th... | Returns the success result with model data |
228,130 | public function getPath ( array $ parameters ) { foreach ( $ parameters as $ parameterName => $ parameterValue ) { $ parameterMethod = 'set' . ucfirst ( $ parameterName ) ; $ this -> $ parameterMethod ( $ parameterValue ) ; } return $ this -> buildPath ( ) ; } | returns the resource path which is usable by a client |
228,131 | protected function buildPath ( ) { $ urlParameters = array ( ) ; $ parameters = get_object_vars ( $ this ) ; foreach ( $ parameters as $ parameterName => $ parameterValue ) { if ( true === is_null ( $ parameterValue ) ) { continue ; } if ( $ parameterName === 'apiKey' ) { $ parameterName = 'api_key' ; } $ urlParameters... | builds a API query string path |
228,132 | protected function getArrayPathParameter ( $ parameterName , array $ parameterValue ) { $ urlParameter = array ( ) ; foreach ( $ parameterValue as $ parameterValueValue ) { $ urlParameter [ ] = $ this -> getPathParameter ( $ parameterName , $ parameterValueValue ) ; } return implode ( '&' , $ urlParameter ) ; } | iterates over an array parameter value |
228,133 | protected function prepareAllAttributes ( ) { static :: $ all_attributes = static :: $ my_attributes ; $ parent = get_class ( $ this ) ; while ( ( $ parent = get_parent_class ( $ parent ) ) != 'Palmabit\Library\Models\SingleTableInheritance' ) { static :: $ all_attributes = array_merge ( static :: $ all_attributes , $ ... | Fill the array containing all the attributes that belongs to the class |
228,134 | public function newQuery ( $ excludeDeleted = true ) { $ builder = parent :: newQuery ( $ excludeDeleted ) ; $ builder -> where ( static :: $ table_type_field , '=' , $ this -> table_type ) ; return $ builder ; } | Update newQuery to fetch data of the right type |
228,135 | public function delete ( Resource \ ResourceId $ resourceId ) { $ this -> crudRepositoryAdapter -> deleteResource ( $ this -> resourceType , $ resourceId ) ; } | Delete Resource by it s resource id |
228,136 | public function update ( Resource \ ResourceData $ resourceData ) { return $ this -> crudRepositoryAdapter -> updateResource ( $ this -> resourceType , $ resourceData ) ; } | Update resource data |
228,137 | public function read ( Resource \ ResourceId $ resourceId ) { return $ this -> crudRepositoryAdapter -> getResource ( $ this -> resourceType , $ resourceId ) ; } | Read data for a single resource |
228,138 | public function bindColumn ( $ column , & $ variable , $ type = null ) : bool { try { return $ this -> pdoStatement -> bindColumn ( $ column , $ variable , $ type , null , null ) ; } catch ( PDOException $ pdoe ) { throw new DatabaseException ( $ pdoe -> getMessage ( ) , $ pdoe ) ; } } | bind a result column to a variable |
228,139 | public function fetch ( int $ fetchMode = null , array $ driverOptions = [ ] ) { if ( null === $ fetchMode ) { $ fetchMode = PDO :: FETCH_ASSOC ; } try { return $ this -> pdoStatement -> fetch ( $ fetchMode , $ driverOptions [ 'cursorOrientation' ] ?? null , $ driverOptions [ 'cursorOffset' ] ?? null ) ; } catch ( PDOE... | fetch a result |
228,140 | public function fetchOne ( int $ columnNumber = 0 ) { try { return $ this -> pdoStatement -> fetchColumn ( $ columnNumber ) ; } catch ( PDOException $ pdoe ) { throw new DatabaseException ( $ pdoe -> getMessage ( ) , $ pdoe ) ; } } | fetch single column from the next row from a result set |
228,141 | public function fetchAll ( int $ fetchMode = null , array $ driverOptions = [ ] ) : array { try { if ( null === $ fetchMode ) { return $ this -> pdoStatement -> fetchAll ( ) ; } if ( PDO :: FETCH_COLUMN == $ fetchMode ) { return $ this -> pdoStatement -> fetchAll ( PDO :: FETCH_COLUMN , $ driverOptions [ 'columnIndex' ... | returns an array containing all of the result set rows |
228,142 | public function next ( ) : bool { try { return $ this -> pdoStatement -> nextRowset ( ) ; } catch ( PDOException $ pdoe ) { throw new DatabaseException ( $ pdoe -> getMessage ( ) , $ pdoe ) ; } } | moves the internal result pointer to the next result row |
228,143 | public function count ( ) : int { try { return $ this -> pdoStatement -> rowCount ( ) ; } catch ( PDOException $ pdoe ) { throw new DatabaseException ( $ pdoe -> getMessage ( ) , $ pdoe ) ; } } | returns the number of rows affected by the last SQL statement |
228,144 | public function free ( ) : bool { try { return $ this -> pdoStatement -> closeCursor ( ) ; } catch ( PDOException $ pdoe ) { throw new DatabaseException ( $ pdoe -> getMessage ( ) , $ pdoe ) ; } } | releases resources allocated of the result set |
228,145 | protected function parseClassEvent ( $ class , $ prefix ) { if ( Str :: contains ( $ class , '@' ) ) return explode ( '@' , $ class ) ; $ method = Str :: contains ( $ prefix , 'composing' ) ? 'compose' : 'create' ; return [ $ class , $ method ] ; } | Parse a class based composer name . |
228,146 | protected function _render ( $ context = null ) { if ( is_null ( $ context ) ) { $ context = [ ] ; } return $ this -> _replaceTokens ( $ this -> _getPlaceholderTemplate ( ) , $ context , $ this -> _getTokenStart ( ) , $ this -> _getTokenEnd ( ) , $ this -> _getDefaultPlaceholderValue ( ) ) ; } | Renders this template with context . |
228,147 | protected function setProp ( string $ property , $ value ) { if ( \ property_exists ( $ this , $ property ) ) { $ this -> { $ property } = $ value ; } } | Set a property on the ZenodorusArguments object . |
228,148 | public function get ( string $ property , $ callback = false ) { if ( isset ( $ this -> processed [ $ property ] ) ) { if ( $ callback ) { return \ call_user_func ( $ callback , $ this -> processed [ $ property ] ) ; } return $ this -> processed [ $ property ] ; } return false ; } | Get a specific value . |
228,149 | protected function connectToMySql ( $ mySQLconfig ) { if ( is_null ( $ this -> mySQLconnection ) ) { extract ( $ mySQLconfig ) ; $ this -> mySQLconnection = new \ mysqli ( $ host , $ username , $ password , $ database , $ port ) ; if ( $ this -> mySQLconnection -> connect_error ) { $ this -> mySQLconnection = null ; $ ... | Initiates connection to MySQL |
228,150 | protected function getFieldOutputDate ( $ value ) { $ defaultValue = $ this -> getFieldValue ( $ value ) ; if ( $ defaultValue == 'NULL' ) { $ defaultValue = date ( 'Y-m-d' ) ; } $ inA = [ 'type' => 'text' , 'name' => $ value [ 'COLUMN_NAME' ] , 'id' => $ value [ 'COLUMN_NAME' ] , 'value' => $ defaultValue , 'size' => ... | Returns a Date field 2 use in a form |
228,151 | protected function getMySQLqueryWithParameterIdentifier ( $ sQuery , $ paramIdentifier ) { $ sReturn = true ; if ( strpos ( $ sQuery , $ paramIdentifier ) === false ) { $ sReturn = false ; } return $ sReturn ; } | Provides a detection if given Query does contain a Parameter that may require statement processing later on |
228,152 | protected function setMySQLquery2Server ( $ sQuery , $ sReturnType = null , $ ftrs = null ) { if ( is_null ( $ sReturnType ) ) { $ this -> mySQLconnection -> query ( html_entity_decode ( $ sQuery ) ) ; return '' ; } elseif ( is_null ( $ this -> mySQLconnection ) ) { return [ 'customError' => $ this -> lclMsgCmn ( 'i18n... | Transmit Query to MySQL server and get results back |
228,153 | public function addParameter ( $ key , $ data ) { if ( ! is_string ( $ key ) ) { throw new \ RuntimeException ( 'Only strings can be given as parameter keys. Got "' . gettype ( $ key ) . '".' ) ; } if ( ! is_string ( $ data ) && ! is_callable ( $ data ) ) { throw new \ RuntimeException ( 'The "data" parameter must eith... | Adds a parameter that can occur in Fact texts . |
228,154 | public function getCatalogItem ( $ name ) { if ( ! ( $ this -> getFiller ( ) instanceof FillerInterface ) ) { return ; } try { $ list = $ this -> search ( [ 'name' => $ name ] ) ; if ( count ( $ list ) == 1 ) { return $ this -> getFiller ( ) -> fillFromSearchResult ( array_pop ( $ list ) ) ; } } catch ( \ Exception $ e... | Try search item by name and fill it if can . |
228,155 | public static function user ( ) { if ( Session :: has ( 'user' ) ) { $ userModel = Config :: get ( 'user' ) ; $ model = new $ userModel ( ) ; return $ model -> find ( Session :: get ( 'user' ) ) ; } return false ; } | Returns the logged in user s data as an object . |
228,156 | public static function attempt ( $ input ) { $ userModel = Config :: get ( 'user' ) ; $ model = new $ userModel ( ) ; $ count = 0 ; foreach ( $ input as $ field => $ value ) { if ( $ field == '_' ) { unset ( $ input [ $ field ] ) ; } else { $ count ++ ; } if ( $ count == 1 ) { $ primary = $ field ; } } if ( ! empty ( $... | Attempt to login the user . If succeeds create a user session . |
228,157 | protected function sanitizeUsername ( ) { $ username = $ this -> has ( 'username' ) ? $ this -> get ( 'username' ) : $ this -> get ( 'first_name' ) . ' ' . $ this -> get ( 'last_name' ) ; return Str :: slug ( $ username , config ( 'arcanesoft.auth.slug-separator' , '.' ) ) ; } | Sanitize the username . |
228,158 | protected function configureDataProperties ( ) { if ( isset ( $ this -> properties [ self :: PROPERTY_DATA ] ) ) { $ this -> data -> setProperties ( $ this -> properties [ 'data' ] ) ; } return $ this ; } | Passes Data properties to Endpoint Data object |
228,159 | private function clear ( $ directory , OutputInterface $ output ) { $ handle = opendir ( $ directory ) ; $ ignore = [ '.' , '..' , '.gitkeep' ] ; while ( $ file = readdir ( $ handle ) ) { if ( ! in_array ( $ file , $ ignore ) ) { $ output -> writeln ( "Clearing file {$file} from the cache" ) ; unlink ( $ directory . $ ... | Handles clearning out files from given location . |
228,160 | public function BeforeDelete ( $ item ) { $ navPages = NavigationPage :: Schema ( ) -> FetchByPage ( false , $ item ) ; foreach ( $ navPages as $ navPage ) { $ item = $ navPage -> GetItem ( ) ; $ tree = new TreeBuilder ( new NavigationTreeProvider ( $ item -> GetNavigation ( ) ) ) ; $ tree -> Remove ( $ item ) ; } } | Deletes the navi items related to the page |
228,161 | public function onInsert ( EventInterface $ event ) { $ values = $ event -> getParam ( 'values' ) ; $ now = new DateTime ( ) ; $ now = $ now -> format ( 'Y-m-d h:i:s' ) ; $ values [ 'created_at' ] = $ now ; $ values [ 'last_updated_at' ] = $ now ; $ event -> setParam ( 'values' , $ values ) ; } | Add current DateTime value for fields created_at and last_updated_at |
228,162 | public function onUpdate ( EventInterface $ event ) { $ values = $ event -> getParam ( 'values' ) ; $ now = new DateTime ( ) ; $ values [ 'last_updated_at' ] = $ now -> format ( 'Y-m-d h:i:s' ) ; $ event -> setParam ( 'values' , $ values ) ; } | Add current DateTime value for field last_updated_at |
228,163 | public function rewind ( ) { if ( $ this -> datespan instanceof Day ) { $ this -> current = $ this -> datespan ; } else { $ this -> current = new Day ( $ this -> datespan -> start ( ) ) ; } } | returns iteration back to first day of datespan |
228,164 | public function contains ( $ key , $ value ) { return in_array ( $ value , $ this -> get ( $ key , NULL , FALSE ) ) ; } | Returns TRUE if the given HTTP header contains the given value . |
228,165 | public static function fromString ( $ query , $ urlEncoding = true ) { static $ qp ; if ( ! $ qp ) { $ qp = new QueryParser ( ) ; } $ q = new static ( ) ; if ( $ urlEncoding !== true ) { $ q -> setEncodingType ( $ urlEncoding ) ; } $ qp -> parseInto ( $ q , $ query , $ urlEncoding ) ; return $ q ; } | Parse a query string into a Query object |
228,166 | public static function duplicateAggregator ( ) { return function ( array $ data ) { return self :: walkQuery ( $ data , '' , function ( $ key , $ prefix ) { return is_int ( $ key ) ? $ prefix : "{$prefix}[{$key}]" ; } ) ; } ; } | Query string aggregator that does not aggregate nested query string values and allows duplicates in the resulting array . |
228,167 | public static function walkQuery ( array $ query , $ keyPrefix , callable $ prefixer ) { $ result = [ ] ; foreach ( $ query as $ key => $ value ) { if ( $ keyPrefix ) { $ key = $ prefixer ( $ key , $ keyPrefix ) ; } if ( is_array ( $ value ) ) { $ result += self :: walkQuery ( $ value , $ key , $ prefixer ) ; } elseif ... | Easily create query aggregation functions by providing a key prefix function to this query string array walker . |
228,168 | public function getInteger ( $ key ) { $ resolved = false ; $ value = $ this -> getByKey ( $ key , $ this -> data , $ resolved ) ; if ( $ resolved ) { return ( int ) $ value ; } if ( func_num_args ( ) > 1 ) { return func_get_arg ( 1 ) ; } throw new \ OutOfBoundsException ( 'Configuration setting not found: "' . $ key .... | Get an integer value by key . |
228,169 | public function getFloat ( $ key ) { $ resolved = false ; $ value = $ this -> getByKey ( $ key , $ this -> data , $ resolved ) ; if ( $ resolved ) { return floatval ( $ value ) ; } if ( func_num_args ( ) > 1 ) { return func_get_arg ( 1 ) ; } throw new \ OutOfBoundsException ( 'Configuration setting not found: "' . $ ke... | Get a floating point value by key . |
228,170 | public function leave ( ) : void { if ( $ this -> canTrack ( ) ) { $ track = $ this -> orm -> tracking -> getLatest ( $ this -> user -> getUid ( ) ) ; if ( $ track ) { $ timeOnPage = time ( ) - $ track -> inserted -> getTimestamp ( ) ; if ( $ timeOnPage < ( $ this -> minTimeBetweenVisits * 60 ) ) { $ track -> timeOnPag... | Zaznam odchodu ze stranky |
228,171 | public function track ( ) : void { if ( $ this -> canTrack ( ) ) { $ track = new TrackingEntity ; $ track -> uid = $ this -> user -> getUid ( ) ; $ track -> inserted = new DateTime ; $ track -> url = $ this -> getParam ( 'url' ) ; $ track -> referer = $ this -> getParam ( 'referer' ) ; $ track -> ip = $ this -> getIp (... | Zaznam prichodu na stranku |
228,172 | private function checkVisits ( Range $ interval ) : void { foreach ( $ this -> orm -> trackingVisits -> findCalculateDate ( $ interval ) as $ date ) { if ( $ date !== null ) { $ date = $ date -> setTime ( 0 , 0 , 0 ) ; $ to = $ date -> modify ( '+23 hour' ) ; $ to = $ to -> modify ( '+59 minute' ) ; $ to = $ to -> modi... | Ulozeni zaznamu pokud jeste nejsou prepocitane |
228,173 | public function findClicksValue ( int $ groupId , Range $ interval ) : ? Result { return $ this -> orm -> clickTracking -> findClicksByValue ( $ groupId , $ interval ) ; } | Pocet kliku podle hondoty |
228,174 | private function getAdapterNode ( ) { $ node = $ this -> createRootNode ( 'adapter' ) ; return $ node -> isRequired ( ) -> addDefaultsIfNotSet ( ) -> children ( ) -> enumNode ( 'type' ) -> values ( [ 'jsonapiorg' , null ] ) -> end ( ) -> scalarNode ( 'service' ) -> cannotBeEmpty ( ) -> end ( ) -> end ( ) -> validate ( ... | Gets the api adapter configuration node . |
228,175 | private function getMetadataNode ( ) { $ node = $ this -> createRootNode ( 'metadata' ) ; return $ node -> addDefaultsIfNotSet ( ) -> children ( ) -> arrayNode ( 'drivers' ) -> defaultValue ( [ 'default' => [ 'type' => 'yml' ] ] ) -> useAttributeAsKey ( 'name' ) -> prototype ( 'array' ) -> performNoDeepMerging ( ) -> c... | Gets the metadata configuration node . |
228,176 | private function getPersistersNode ( ) { $ node = $ this -> createRootNode ( 'persisters' ) ; return $ node -> isRequired ( ) -> useAttributeAsKey ( 'name' ) -> prototype ( 'array' ) -> children ( ) -> enumNode ( 'type' ) -> values ( [ 'mongodb' , null ] ) -> end ( ) -> scalarNode ( 'service' ) -> cannotBeEmpty ( ) -> ... | Gets the persisters configuration node . |
228,177 | private function getRestNode ( ) { $ node = $ this -> createRootNode ( 'rest' ) ; return $ node -> addDefaultsIfNotSet ( ) -> children ( ) -> scalarNode ( 'root_endpoint' ) -> isRequired ( ) -> cannotBeEmpty ( ) -> defaultValue ( 'modlr/api' ) -> validate ( ) -> always ( function ( $ v ) { $ v = $ this -> formatRestEnd... | Gets the rest configuration node . |
228,178 | private function validateLibClassExists ( $ subClass , $ path ) { $ class = Utility :: getLibraryClass ( $ subClass ) ; if ( false === class_exists ( $ class ) ) { throw new InvalidConfigurationException ( sprintf ( 'The library class "%s" was not found for "%s" - was the library installed?' , $ class , $ path ) ) ; } ... | Validates that a library class name exists . |
228,179 | private function validateMetadataCache ( array $ config ) { if ( false === $ config [ 'enabled' ] ) { return $ this ; } $ this -> validateTypeAndService ( $ config , 'as3_modlr.metadata.cache' ) ; switch ( $ config [ 'type' ] ) { case 'redis' : $ this -> validateMetadataCacheRedis ( $ config ) ; break ; default : break... | Validates the metadata cache config . |
228,180 | private function validateMetadataDrivers ( array $ drivers ) { foreach ( $ drivers as $ name => $ config ) { $ this -> validateTypeAndService ( $ config , sprintf ( 'as3_modlr.metadata.drivers.%s' , $ name ) ) ; } return $ this ; } | Validates the metadata drivers config . |
228,181 | private function validatePersisters ( array $ persisters ) { foreach ( $ persisters as $ name => $ config ) { $ this -> validateTypeAndService ( $ config , sprintf ( 'as3_modlr.persisters.%s' , $ name ) ) ; switch ( $ config [ 'type' ] ) { case 'mongodb' : $ this -> validateLibClassExists ( 'Persister\MongoDb\Persister... | Validates the persisters config . |
228,182 | private function validateSearchClients ( array $ clients ) { foreach ( $ clients as $ name => $ config ) { $ this -> validateTypeAndService ( $ config , sprintf ( 'as3_modlr.search_clients.%s' , $ name ) ) ; switch ( $ config [ 'type' ] ) { case 'elastic' : $ this -> validateLibClassExists ( 'Search\Elastic\Client' , s... | Validates the search clients config . |
228,183 | private function validateTypeAndService ( array $ config , $ path ) { if ( ! isset ( $ config [ 'type' ] ) && ! isset ( $ config [ 'service' ] ) ) { throw new InvalidConfigurationException ( sprintf ( 'You must set one of "type" or "service" for "%s"' , $ path ) ) ; } if ( isset ( $ config [ 'type' ] ) && isset ( $ con... | Validates a configuration that uses type and service as options . |
228,184 | protected function setCurrentEndpoint ( EndpointInterface $ Endpoint ) { if ( isset ( $ this -> currentEndPoint ) ) { unset ( $ this -> lastEndPoint ) ; $ this -> lastEndPoint = $ this -> currentEndPoint ; unset ( $ this -> currentEndPoint ) ; } $ this -> currentEndPoint = $ Endpoint ; return $ this ; } | Rotates current Endpoint to Last Endpoint and sets Current Endpoint with passed in Endpoint |
228,185 | public static function reserve ( $ queue ) { $ payload = Resque :: pop ( $ queue ) ; if ( ! is_array ( $ payload ) ) { return false ; } return new Job ( $ queue , $ payload ) ; } | Find the next available job from the specified queue and return an instance of Job for it . |
228,186 | protected function generatePath ( SplFileInfo $ fileinfo , $ skeletonPath , $ targetPath , Inflector $ inflector ) { return $ inflector -> translate ( sprintf ( '%s%s' , $ targetPath , str_replace ( $ skeletonPath , '' , $ fileinfo -> getRealPath ( ) ) ) ) ; } | generate targer file path from source path . |
228,187 | protected function getMetadata ( $ templateFileContent ) { $ regex = '/\@MajoraGenerator\((.+)\)/' ; $ templateFileMetadata = array ( 'force_generation' => false ) ; if ( ! preg_match_all ( $ regex , $ templateFileContent , $ matches , PREG_SET_ORDER ) ) { return $ templateFileMetadata ; } foreach ( $ matches as $ matc... | parse metadata from given template content . |
228,188 | protected function generateDir ( $ destDirPath ) { if ( $ this -> filesystem -> exists ( $ destDirPath ) ) { return ; } $ this -> filesystem -> mkdir ( $ destDirPath ) ; $ this -> logger -> info ( sprintf ( 'dir created: %s' , $ destDirPath ) ) ; } | generate dest dir . |
228,189 | public function modify ( SplFileInfo $ generatedFile , SplFileInfo $ templateFile , array $ modifiers , Inflector $ inflector ) { foreach ( $ modifiers as $ modifierAlias => $ modifierData ) { if ( $ modifier = $ this -> contentModifiers -> get ( $ modifierAlias ) ) { $ this -> filesystem -> dumpFile ( $ generatedFile ... | run content modifiers on given file content . |
228,190 | public function createLog ( $ handler , $ name , $ ident , $ conf = null , $ level = null ) { $ this -> log = \ Log :: singleton ( $ handler , $ name , $ ident , $ conf , $ level ) ; } | This creates a specific type of log instance |
228,191 | public function fromXPath2Exception ( $ ex ) { if ( ! $ this -> log ) return ; return $ this -> log -> warning ( $ ex -> ErrorCode . " " . $ ex -> getMessage ( ) ) ; } | A convenience function for logging a event about an XPath conformance issue . It will log a message at the PEAR_LOG_DEBUG log level . |
228,192 | public function setDebugLog ( ) { $ logConsole = \ Log :: singleton ( 'console' , '' , 'console' , array ( 'lineFormat' => '%{timestamp} [%{priority}] %{message}' , 'timeFormat' => '%Y-%m-%d %H:%M:%S' , ) ) ; $ logError = \ Log :: singleton ( 'error_log' , PEAR_LOG_TYPE_SYSTEM , 'error_log' , array ( 'lineFormat' => '[... | Set log output for console and error_log |
228,193 | public function hookDashboardHandlers ( array & $ handlers ) { $ weight = count ( $ handlers ) ; $ model = $ this -> getModel ( ) ; $ settings = $ this -> module -> getSettings ( 'ga_report' ) ; foreach ( $ model -> getHandlers ( ) as $ id => $ handler ) { if ( ! in_array ( $ id , $ settings [ 'dashboard' ] ) ) { conti... | Implements hook dashboard . handlers |
228,194 | public function hookConstructControllerBackend ( $ controller ) { if ( $ controller -> isQuery ( 'ga.update' ) ) { $ store_id = $ controller -> getQuery ( 'ga.update.store_id' , '' ) ; $ handler_id = $ controller -> getQuery ( 'ga.update.handler_id' , '' ) ; $ this -> getModel ( ) -> clearCache ( $ handler_id , $ store... | Implements hook construct . controller . backend |
228,195 | public function getReport ( $ handler , $ settings = null ) { if ( ! is_array ( $ handler ) ) { $ handler = $ this -> getHandler ( $ handler ) ; } if ( ! isset ( $ settings ) ) { $ settings = $ this -> module -> getSettings ( 'ga_report' ) ; } return $ this -> getModel ( ) -> get ( $ handler , $ settings ) ; } | Returns an array of Google Anylytics report |
228,196 | public function setPPN ( $ ppn ) { $ ppnField = $ this -> getFirstMatchingField ( '003@/00' ) ; if ( $ ppnField ) { $ ppnSubfield = $ ppnField -> getNthSubfield ( '0' , 0 ) ; if ( $ ppnSubfield ) { $ ppnSubfield -> setValue ( $ ppn ) ; } else { $ ppnField -> append ( new Subfield ( '0' , $ ppn ) ) ; } } else { $ this -... | Set the Pica production number . |
228,197 | public function getMatcherConfiguration ( $ matcherClass ) { if ( ! array_key_exists ( $ matcherClass , $ this -> configuration [ "matcher_settings" ] ) ) { return null ; } $ configuration = $ this -> configuration [ "matcher_settings" ] [ $ matcherClass ] ; unset ( $ this -> configuration [ "matcher_settings" ] [ $ ma... | Returns the configuration for the given matcher or null . |
228,198 | public function configure ( Closure $ callback ) { if ( ! is_array ( $ configuration = $ callback ( $ this -> configuration ) ) ) { throw new Exceptions \ InvalidConfigurationException ( $ configuration ) ; } $ this -> configuration = array_merge ( $ this -> defaultConfiguration , $ configuration ) ; } | Configures Essence via the given Closure . |
228,199 | public function setBuilder ( AssertionBuilder $ builder ) { if ( ! is_null ( $ this -> builder ) and $ this -> configuration [ "implicit_validation" ] ) { $ this -> go ( ) ; } $ this -> builders [ ] = $ builder ; $ this -> builder = $ builder ; } | Replaces the stored AssertionBuilder instance with the given one . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.