idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
6,800 | public function get ( string $ name , $ default = null ) { $ path = explode ( '.' , $ name ) ; $ current = $ this -> data ; foreach ( $ path as $ field ) { if ( isset ( $ current ) && isset ( $ current [ $ field ] ) ) { $ current = $ current [ $ field ] ; } elseif ( is_array ( $ current ) && isset ( $ current [ $ field... | Get value by using dot notation for nested arrays . |
6,801 | public static function registerCustomRouteClass ( string $ routeKey , string $ routeClass ) { self :: checkRegisterAvailability ( ) ; if ( ! class_exists ( $ routeClass ) ) throw new AppLogicException ( 'Class ' . $ routeClass . ' does not exist' ) ; self :: $ customRouteClasses [ $ routeKey ] = $ routeClass ; } | Can t set custom actions . Only parsable from URL |
6,802 | public function getHttpClient ( $ path ) { $ this -> httpClient = new Http \ Client ( ) ; $ this -> httpClient -> setAdapter ( $ this -> getHttpAdapter ( ) ) ; $ this -> httpClient -> setUri ( $ this -> options [ 'base_url' ] . $ path ) ; return $ this -> httpClient ; } | Get Http Client |
6,803 | public function getHttpAdapter ( ) { if ( null === $ this -> httpAdapter ) { $ this -> httpAdapter = new Http \ Client \ Adapter \ Curl ( ) ; $ this -> httpAdapter -> setOptions ( array ( 'curloptions' => array ( CURLOPT_SSL_VERIFYPEER => false , ) , ) ) ; } return $ this -> httpAdapter ; } | Get Http Adapter |
6,804 | static function getInstance ( eZContentObjectAttribute $ objectAttribute ) { $ datatypeString = $ objectAttribute -> attribute ( 'data_type_string' ) ; $ dataTypeHandlers = self :: $ ogIni -> variable ( 'OpenGraph' , 'DataTypeHandlers' ) ; if ( array_key_exists ( $ datatypeString , $ dataTypeHandlers ) ) { if ( class_e... | Gets the instance of Open Graph attribute handler for the attribute |
6,805 | final public function commitChanges ( ) { if ( null !== $ this -> changes ) { $ this -> lastCommittedEventSequenceNumber = $ this -> changes -> lastSequenceNumber ( ) ; $ this -> changes -> commit ( ) ; } } | Clears all recorded events . |
6,806 | final protected function applyChange ( Serializable $ payload ) { $ this -> apply ( $ payload ) ; $ this -> changes ( ) -> addEventFromPayload ( $ payload ) ; } | Mutate the state of the aggregate by applying a domain event . Keep track of the change until it has been successfully committed . |
6,807 | final private function replayChange ( Event $ event ) { $ this -> apply ( $ event -> payload ( ) ) ; $ this -> lastCommittedEventSequenceNumber = $ event -> sequenceNumber ( ) ; } | Mutate the state of the aggregate by applying the domain event contained into the message . Synchronize the aggregate version with the one provided by the message . |
6,808 | final private function apply ( Serializable $ payload ) { $ method = $ this -> applyMethod ( $ payload ) ; $ this -> $ method ( $ payload ) ; } | Mutate the state of the aggregate by applying a domain event . |
6,809 | protected function applyMethod ( Serializable $ payload ) { $ className = get_class ( $ payload ) ; return 'apply' . substr ( $ className , strrpos ( $ className , '\\' ) + 1 ) ; } | Returns method to call for applying a given domain event to the aggregate . This can be overridden to suit your custom naming convention . |
6,810 | final private function changes ( ) { if ( null === $ this -> changes ) { $ lastCommittedEventSequenceNumber = $ this -> lastCommittedEventSequenceNumber ( ) ; $ this -> changes = new DefaultEventContainer ( $ this -> identifier ( ) , $ lastCommittedEventSequenceNumber ) ; } return $ this -> changes ; } | Return the event container containing the uncommitted changes . If there are no pending changes to be committed a new event container will be initialized . |
6,811 | final public static function loadFromHistory ( EventStream $ eventStream ) { $ aggregate = new static ( ) ; while ( $ eventStream -> hasNext ( ) ) { $ aggregate -> replayChange ( $ eventStream -> next ( ) ) ; } return $ aggregate ; } | Roll - out all events to reconstitute the state of the aggregate . |
6,812 | public function setRelationType ( $ type , $ direction = 'bidirectional' , $ whoIsOwningSide = 'source' ) { $ this -> setDirection ( $ direction ) ; $ this -> setType ( $ type ) ; if ( isset ( $ whoIsOwningSide ) ) $ this -> setOwningSide ( $ whoIsOwningSide ) ; return $ this ; } | Setzt alle Eigenschaften der Relation gleichzeitig |
6,813 | public function setJoinColumnNullable ( $ bool ) { $ this -> nullable = $ bool ; $ this -> getJoinColumn ( ) -> setNullable ( $ bool ) ; return $ this ; } | Achtung dies erzeugt die JoinColumn und sollte nur benutzt werdne wenn die Relation schon korrekt gesetzt ist |
6,814 | private function packagePath ( string $ relativePath ) : string { $ packagePath = rtrim ( str_replace ( '/' , DIRECTORY_SEPARATOR , $ this -> packagePath ) , DIRECTORY_SEPARATOR ) ; $ relativePath = ltrim ( str_replace ( '/' , DIRECTORY_SEPARATOR , $ relativePath ) , DIRECTORY_SEPARATOR ) ; return realpath ( $ packageP... | give relative path from package root and return absolute path |
6,815 | public function getList ( ) { $ key = $ this -> name . '_' . md5 ( $ this -> value ) ; if ( isset ( self :: $ listobj [ $ key ] ) ) { return self :: $ listobj [ $ key ] ; } if ( $ this -> value ) { self :: $ listobj [ $ key ] = json_decode ( $ this -> value ) ; } else { self :: $ listobj [ $ key ] = false ; } return se... | Get the list |
6,816 | public function getHeading ( ) { $ list = $ this -> getList ( ) ; if ( isset ( $ list -> heading ) && $ list -> heading ) { return Convert :: html2raw ( $ list -> heading ) ; } return null ; } | Get list heading |
6,817 | public function getItems ( ) { $ list = $ this -> getList ( ) ; if ( isset ( $ list -> items ) && ! empty ( $ list -> items ) ) { $ arrayList = new ArrayList ( ) ; foreach ( $ list -> items as $ id => $ item ) { $ item -> ID = $ id ; $ arrayList -> push ( new ArrayData ( $ item ) ) ; } return $ arrayList ; } return fal... | Get list items |
6,818 | static function encode ( $ data , $ getterPrefixForObjectMethods = 'get' , $ ignoreNulls = false ) { $ type = gettype ( $ data ) ; $ isObject = false ; switch ( $ type ) { case 'string' : return '"' . self :: fixString ( $ data ) . '"' ; case 'number' : ; case 'integer' : ; case 'float' : ; case 'double' : return $ dat... | Encodes a variable into JSON format . |
6,819 | static function decode ( $ json , $ convertObjectsToArrays = false , $ recursionDepth = 512 , $ options = 0 ) { return json_decode ( $ json , $ convertObjectsToArrays , $ recursionDepth , $ options ) ; } | Decodes a JSON content into an object or an array . |
6,820 | public function refreshAccessToken ( OAuthToken $ token ) { $ params = [ 'grant_type' => 'refresh_token' ] ; $ params = array_merge ( $ token -> getParams ( ) , $ params ) ; $ request = $ this -> createRequest ( ) -> setMethod ( 'POST' ) -> setUrl ( $ this -> refreshTokenUrl ) -> setData ( $ params ) ; $ this -> applyC... | Gets new auth token to replace expired one . |
6,821 | protected function _initialize ( ) { $ config = $ this -> _config -> get ( 'joomla' ) ; if ( is_null ( $ config ) || ! is_array ( $ config ) ) { $ config = array ( ) ; } $ defaults = array ( 'name' => 'root' , 'username' => 'root' , 'groups' => array ( 8 ) , 'email' => 'root@localhost.home' ) ; $ this -> _credentials =... | Initializes extension installer . |
6,822 | protected function _getElementFromManifest ( $ manifest , $ manifestPath ) { $ element = '' ; $ type = ( string ) $ manifest -> attributes ( ) -> type ; switch ( $ type ) { case 'component' : $ name = strtolower ( ( string ) $ manifest -> name ) ; $ element = preg_replace ( '/[^A-Z0-9_\.-]/i' , '' , $ name ) ; if ( sub... | Load the element name from the installation manifest . |
6,823 | public function setName ( $ name ) { if ( mb_strpos ( $ name , '\\' ) !== FALSE ) { $ this -> setNamespace ( Code :: getNamespace ( $ name ) ) ; $ this -> name = Code :: getClassName ( $ name ) ; } else { $ this -> name = $ name ; $ this -> namespace = NULL ; } return $ this ; } | Setzt den Namen der Klasse |
6,824 | public function removeInterface ( GClass $ class ) { if ( array_key_exists ( $ n = $ class -> getFQN ( ) , $ this -> interfaces ) ) { unset ( $ this -> interfaces [ $ n ] ) ; } return $ this ; } | Entfernt das Interface aus der Klasse |
6,825 | protected static function get_config ( ) { $ config_file = \ alsvanzelf \ fem \ ROOT_DIR . 'config/github.ini' ; if ( file_exists ( $ config_file ) == false ) { $ exception = bootstrap :: get_library ( 'exception' ) ; throw new $ exception ( 'no github application config found' ) ; } return parse_ini_file ( $ config_fi... | collects a config containing the github app codes from a ini file |
6,826 | public static function get_by_info ( $ info , $ update_oauth_token = true ) { $ mysql = bootstrap :: get_library ( 'mysql' ) ; $ sql = "SELECT * FROM `login_github` WHERE `oauth_token` = '%s';" ; $ login = $ mysql :: select ( 'row' , $ sql , $ info [ 'oauth_token' ] ) ; if ( ! empty ( $ login ) ) { return new static ( ... | checks whether the login match one on file and returns the found login |
6,827 | public static function get_by_user_id ( $ user_id ) { $ mysql = bootstrap :: get_library ( 'mysql' ) ; $ sql = "SELECT * FROM `login_github` WHERE `user_id` = %d;" ; $ login = $ mysql :: select ( 'row' , $ sql , $ user_id ) ; if ( empty ( $ login ) ) { return false ; } return new static ( $ login [ 'id' ] ) ; } | checks whether the given user id match a login on file and returns the found login |
6,828 | public static function get_by_github_username ( $ github_username ) { $ mysql = bootstrap :: get_library ( 'mysql' ) ; $ sql = "SELECT * FROM `login_github` WHERE `github_username` = '%s';" ; $ login = $ mysql :: select ( 'row' , $ sql , $ github_username ) ; if ( empty ( $ login ) ) { return false ; } return new stati... | checks whether the given github username match one on file and returns the found login |
6,829 | public static function get_by_oauth_token ( $ oauth_token ) { $ mysql = bootstrap :: get_library ( 'mysql' ) ; $ sql = "SELECT * FROM `login_github` WHERE `oauth_token` = '%s';" ; $ login = $ mysql :: select ( 'row' , $ sql , $ oauth_token ) ; if ( empty ( $ login ) ) { return false ; } return new static ( $ login [ 'i... | checks whether the given oauth token match one on file and returns the found login |
6,830 | public static function signup ( $ user_id , $ info ) { if ( empty ( $ info [ 'github_username' ] ) || empty ( $ info [ 'oauth_token' ] ) || empty ( $ info [ 'scope' ] ) ) { $ exception = bootstrap :: get_library ( 'exception' ) ; throw new $ exception ( 'all info from ::is_valid() is needed for signup' ) ; } $ mysql = ... | adds a new login connection between a local user and a github account |
6,831 | public function update_oauth_token ( $ new_oauth_token ) { $ mysql = bootstrap :: get_library ( 'mysql' ) ; $ sql = "UPDATE `login_github` SET `oauth_token` = '%s' WHERE `id` = %d;" ; $ binds = [ $ new_oauth_token , $ this -> id ] ; $ mysql :: query ( $ sql , $ binds ) ; } | updates the oauth token for the login |
6,832 | public static function request_authorization ( $ scope = null , $ callback_url = null ) { $ config = static :: get_config ( ) ; if ( ! empty ( $ callback_url ) && strpos ( $ callback_url , $ config [ 'callback_url' ] ) !== 0 ) { $ exception = bootstrap :: get_library ( 'exception' ) ; throw new $ exception ( 'custom ca... | send a user to github to authorize our application |
6,833 | public static function is_valid ( $ callback_data , $ extended = true ) { $ exception = bootstrap :: get_library ( 'exception' ) ; if ( empty ( $ callback_data [ 'state' ] ) ) { throw new $ exception ( 'state expected in oauth callback' ) ; } $ session = bootstrap :: get_library ( 'session' ) ; $ session :: start ( $ s... | checks whether an oauth callback contains a valid state and code |
6,834 | public static function exchange_for_oauth_token ( $ code ) { $ config = static :: get_config ( ) ; $ url = 'https://github.com/login/oauth/access_token' ; $ options = [ 'body' => [ 'client_id' => $ config [ 'client_id' ] , 'client_secret' => $ config [ 'client_secret' ] , 'code' => $ code , ] , 'headers' => [ 'Accept' ... | exchange the temporary code for a lasting oauth token |
6,835 | public static function verify_scope ( $ received_scope , $ requested_scope = 'user:email' ) { if ( strpos ( $ received_scope , $ requested_scope ) !== false ) { return true ; } if ( strpos ( $ requested_scope , ':' ) ) { $ parent_requested_scope = substr ( $ requested_scope , 0 , strpos ( $ requested_scope , ':' ) ) ; ... | checks whether the received scope meets the requested scope |
6,836 | public static function get_user_info ( $ oauth_token ) { $ url = 'https://api.github.com/user' ; $ options = [ 'headers' => [ 'Accept' => 'application/json' , 'Authorization' => 'token ' . $ oauth_token , ] , ] ; $ http = new \ GuzzleHttp \ Client ( ) ; return $ http -> get ( $ url , $ options ) -> json ( ) ; } | gets a users github account details for a given oauth token |
6,837 | public static function verify_user ( $ oauth_token , $ github_username ) { $ known_login = static :: get_by_oauth_token ( $ oauth_token ) ; if ( empty ( $ known_login ) ) { return true ; } if ( $ known_login -> github_username != $ github_username ) { $ exception = bootstrap :: get_library ( 'exception' ) ; throw new $... | checks whether the username belongs to the user identified by the oauth token |
6,838 | public static function doCount ( Criteria $ criteria , $ distinct = false , PropelPDO $ con = null ) { $ criteria = clone $ criteria ; $ criteria -> setPrimaryTableName ( UserPeer :: TABLE_NAME ) ; if ( $ distinct && ! in_array ( Criteria :: DISTINCT , $ criteria -> getSelectModifiers ( ) ) ) { $ criteria -> setDistinc... | Returns the number of rows matching criteria . |
6,839 | public static function doDeleteAll ( PropelPDO $ con = null ) { if ( $ con === null ) { $ con = Propel :: getConnection ( UserPeer :: DATABASE_NAME , Propel :: CONNECTION_WRITE ) ; } $ affectedRows = 0 ; try { $ con -> beginTransaction ( ) ; $ affectedRows += UserPeer :: doOnDeleteCascade ( new Criteria ( UserPeer :: D... | Deletes all rows from the user table . |
6,840 | public function hasAccess ( $ name ) { $ permissions = $ this -> getPermissions ( $ name ) ; $ roles = $ this -> getRoles ( $ name ) ; if ( $ permissions === null && $ roles === null ) { return null ; } return $ this -> keeper -> hasPermissions ( $ permissions ) === true && $ this -> keeper -> hasRoles ( $ roles ) === ... | Check if current user has access to named route |
6,841 | public function getPermissions ( $ name ) { $ route = $ this -> router -> getRoutes ( ) -> getByName ( $ name ) ; if ( $ route === null ) { return null ; } $ permissions = [ ] ; foreach ( $ route -> middleware ( ) as $ middleware ) { if ( strpos ( $ middleware , 'permission:' ) === 0 ) { list ( , $ permission ) = explo... | Get permissions for named route |
6,842 | public function getRoles ( $ name ) { $ route = $ this -> router -> getRoutes ( ) -> getByName ( $ name ) ; if ( $ route === null ) { return null ; } $ roles = [ ] ; $ action = $ route -> getAction ( ) ; if ( array_key_exists ( 'role' , $ action ) ) { $ roles [ ] = $ action [ 'role' ] ; } if ( array_key_exists ( 'roles... | Get roles for named route |
6,843 | public function store ( $ object ) { if ( ! is_object ( $ object ) ) { throw new InvalidArgumentException ( 1 , 'object' ) ; } $ objects = array ( ) ; $ id = $ this -> doStore ( $ this -> freezer -> freeze ( $ object , $ objects ) ) ; if ( $ id !== null ) { $ object -> { $ this -> freezer -> getIdProperty ( ) } = $ id ... | Freezes an object and stores it in the object storage . |
6,844 | public function logMemory ( $ object = null , $ name = 'PHP' , $ literal = false ) { $ memory = memory_get_usage ( ) ; $ dataType = '' ; if ( ! is_null ( $ object ) && ! $ literal ) { $ memory = strlen ( serialize ( $ object ) ) ; $ dataType = gettype ( $ object ) ; } else if ( is_numeric ( $ object ) && $ literal ) { ... | Logs memory usage of a variable If no parameter is passed in logs current memory usage |
6,845 | public function logError ( Exception $ exception , $ message = '' ) { if ( empty ( $ message ) ) { $ message = $ exception -> getMessage ( ) ; } array_push ( $ this -> store , array ( 'data' => $ message , 'file' => $ exception -> getFile ( ) , 'line' => $ exception -> getLine ( ) , 'type' => 'error' ) ) ; } | Logs exception with optional message override |
6,846 | public function logSpeed ( $ name = 'Point in Time' , $ literalTime = null ) { $ time = microtime ( true ) ; if ( ! is_null ( $ literalTime ) && is_float ( $ literalTime ) ) { $ time = $ literalTime ; } array_push ( $ this -> store , array ( 'data' => $ time , 'name' => $ name , 'type' => 'speed' ) ) ; } | Logs current time with optional message |
6,847 | public function setMatchTypes ( $ matchTypes ) { if ( is_array ( $ matchTypes ) ) { $ this -> matchTypes = $ matchTypes ; } else { foreach ( ( array ) $ matchTypes as $ key => $ matchType ) { $ this -> matchTypes [ $ key ] = $ matchType ; } } } | Match types are used to replace given search with replace |
6,848 | public function mount ( $ baseroute , $ callable , $ extra = [ ] ) { $ Route = clone $ this -> Route ; $ this -> Route -> addExtra ( $ extra ) ; $ curBaseroute = $ this -> baseUri ; $ this -> baseUri .= $ baseroute ; $ callable ( $ this ) ; $ this -> Route = $ Route ; $ this -> baseUri = $ curBaseroute ; } | Mount multiple routes via callabck |
6,849 | public function findRequestMethod ( ) { $ method = $ _SERVER [ "REQUEST_METHOD" ] ; if ( $ method === "POST" ) { if ( isset ( $ _SERVER [ "X-HTTP-Method-Override" ] ) ) { $ method = $ _SERVER [ "X-HTTP-Method-Override" ] ; } } return $ this -> method = $ method ; } | Automatically find the request method |
6,850 | public function findUri ( ) { $ uri = parse_url ( $ _SERVER [ "REQUEST_URI" ] , PHP_URL_PATH ) ; return ( $ this -> lowerCase ) ? strtolower ( $ uri ) : $ uri ; } | Automatically find the current uri using baseuri |
6,851 | public function addRoute ( $ method , $ route , $ action , $ extra = [ ] ) { $ name = ( isset ( $ extra [ "name" ] ) ) ? $ extra [ "name" ] : $ route ; if ( isset ( $ this -> rawRoutes [ $ name ] ) ) { $ Route = $ this -> rawRoutes [ $ name ] ; } else { $ Route = clone $ this -> Route ; $ Route -> route = $ this -> bas... | Add new route to list of available routes |
6,852 | public function getMatchType ( $ type , $ default = null ) { if ( isset ( $ this -> matchTypes [ $ type ] ) ) { return $ this -> matchTypes [ $ type ] ; } else if ( $ default !== null ) { return $ default ; } else { throw new MatchTypeNotFoundExeption ( "Unknow match type" ) ; } } | Return regex if type is defined otherwise returns default value . |
6,853 | public function normalize ( $ route ) { if ( mb_substr ( $ route , - 1 , 1 ) == "/" ) { $ route = substr ( $ route , 0 , - 1 ) ; } $ result = explode ( "/" , $ route ) ; $ result [ 0 ] = $ this -> baseUri ; $ ret = [ ] ; foreach ( $ result as $ v ) { if ( ! $ v ) { continue ; } if ( ( $ v [ 0 ] ) === "?{" ) { $ ret [ ]... | Normalize route structure and extract dynamic and optional parts |
6,854 | protected function parseRoutes ( $ routes ) { $ tree = [ ] ; foreach ( $ routes as $ Route ) { $ node = & $ tree ; $ routeSegments = $ this -> normalize ( $ Route -> route ) ; foreach ( $ routeSegments as $ segment ) { if ( ! isset ( $ node [ $ segment [ "use" ] ] ) ) { $ node [ $ segment [ "use" ] ] = [ "name" => $ se... | Build tree structure from all routes . |
6,855 | public function split ( int $ max ) : iterable { $ pos = 0 ; $ total = count ( $ this -> values ) ; while ( $ pos < $ total ) { $ clone = clone $ this ; $ clone -> values = array_slice ( $ this -> values , $ pos , $ max ) ; $ pos += $ max ; yield $ clone ; } } | Split into multiple INSERT statements . |
6,856 | function save ( ) { if ( ! $ this -> blnChanged ) { return ; } $ flags = JSON_PRETTY_PRINT ; $ strContent = json_encode ( $ this -> options , $ flags ) ; file_put_contents ( __CODEGEN_OPTION_FILE__ , $ strContent ) ; $ this -> blnChanged = false ; } | Save the current configuration into the options file . |
6,857 | public function setOption ( $ strTableName , $ strFieldName , $ strOptionName , $ mixValue ) { $ this -> options [ $ strTableName ] [ $ strFieldName ] [ $ strOptionName ] = $ mixValue ; $ this -> blnChanged = true ; } | Set an option for a widget associated with the given table and field . |
6,858 | public function setOptions ( $ strClassName , $ strFieldName , $ mixValue ) { if ( empty ( $ mixValue ) ) { unset ( $ this -> options [ $ strClassName ] [ $ strFieldName ] ) ; } else { $ this -> options [ $ strClassName ] [ $ strFieldName ] = $ mixValue ; } $ this -> blnChanged = true ; } | Bulk option setting . |
6,859 | public function unsetOption ( $ strClassName , $ strFieldName , $ strOptionName ) { unset ( $ this -> options [ $ strClassName ] [ $ strFieldName ] [ $ strOptionName ] ) ; $ this -> blnChanged = true ; } | Remove the option |
6,860 | public function getOption ( $ strClassName , $ strFieldName , $ strOptionName ) { if ( isset ( $ this -> options [ $ strClassName ] [ $ strFieldName ] [ $ strOptionName ] ) ) { return $ this -> options [ $ strClassName ] [ $ strFieldName ] [ $ strOptionName ] ; } else { return null ; } } | Lookup an option . |
6,861 | public function getOptions ( $ strClassName , $ strFieldName ) { if ( isset ( $ this -> options [ $ strClassName ] [ $ strFieldName ] ) ) { return $ this -> options [ $ strClassName ] [ $ strFieldName ] ; } else { return array ( ) ; } } | Return all the options associated with the given table and field . |
6,862 | public function serialize ( ) { $ raw = [ ] ; foreach ( $ this -> listProperties ( ) as $ propName ) { $ raw [ $ propName ] = $ this -> { $ propName } ; } $ raw [ '_try_index' ] = $ this -> _try_index + 1 ; return serialize ( $ raw ) ; } | This default implementation stores all public and protected properties . |
6,863 | public function getFolderChildrens ( array $ input ) { $ organizationId = $ this -> AuthenticationManager -> getCurrentUserOrganization ( 'id' ) ; $ file = $ this -> File -> byId ( $ input [ 'id' ] ) ; $ fileTree = array ( 'text' => $ file -> name , 'state' => array ( 'opened' => true ) , 'icon' => $ file -> icon , 'ch... | Get Files children |
6,864 | public function getElementFiles ( array $ systemReferences , $ formatAsHtml = true , $ databaseConnectionName = null , $ organizationId = null ) { $ files = array ( ) ; if ( empty ( $ organizationId ) ) { $ organizationId = $ this -> AuthenticationManager -> getCurrentUserOrganizationId ( ) ; } foreach ( $ systemRefere... | Get element files by system parent type and by system parent id |
6,865 | public function getLocalFilePath ( $ filename , $ route , & $ isTempFile , $ includeStoragePath = false ) { $ isTempFile = false ; if ( $ this -> Config -> get ( 'filesystems.default' ) == 'gcs' ) { $ isTempFile = true ; $ this -> Storage -> disk ( 'local' ) -> put ( '//temp/' . $ filename , $ this -> Storage -> read (... | Get local file path |
6,866 | public function servePrivateFile ( $ key ) { $ File = $ this -> File -> byKeyAndPublic ( $ key , false ) -> first ( ) ; if ( ! is_null ( $ File ) ) { return $ this -> serveFile ( $ File -> system_type , $ File -> system_route , $ File -> name ) ; } return $ this -> Redirector -> to ( $ this -> AppManager -> getErrorPag... | Serve private file |
6,867 | public function connect ( ) { if ( $ this -> isConnected ( ) ) { return true ; } if ( ! $ this -> isEnabled ( ) ) { throw new MissingDriverException ( sprintf ( '%s driver extension is not enabled' , $ this -> getDriver ( ) ) ) ; } $ this -> _connections [ $ this -> getContext ( ) ] = new PDO ( $ this -> getDsn ( ) , $... | Connect to the database using PDO . |
6,868 | public function resolveBind ( $ field , $ value , array $ schema = [ ] ) { $ type = null ; if ( $ field instanceof Func ) { return [ $ value , $ this -> resolveType ( $ value ) ] ; } if ( $ value instanceof RawExpr ) { $ value = $ value -> getValue ( ) ; } if ( $ value === null ) { $ type = PDO :: PARAM_NULL ; } else i... | Resolve the bind value and the PDO binding type . |
6,869 | public function resolveParams ( Query $ query ) { $ params = [ ] ; $ schema = $ query -> getRepository ( ) -> getSchema ( ) -> getColumns ( ) ; foreach ( $ query -> getGroupedBindings ( ) as $ groupedBinds ) { foreach ( $ groupedBinds as $ binds ) { $ params [ ] = $ this -> resolveBind ( $ binds [ 'field' ] , $ binds [... | Resolve the list of values that will be required for PDO statement binding . |
6,870 | public function resolveType ( $ value ) { if ( $ value === null ) { $ type = PDO :: PARAM_NULL ; } else if ( is_resource ( $ value ) ) { $ type = PDO :: PARAM_LOB ; } else if ( is_numeric ( $ value ) ) { if ( is_float ( $ value ) || is_double ( $ value ) ) { $ type = PDO :: PARAM_STR ; } else { $ type = PDO :: PARAM_IN... | Resolve the value type for PDO parameter binding and quoting . |
6,871 | public static function parse ( $ cmd ) { if ( empty ( $ cmd ) ) { return false ; } $ params = array ( ) ; $ in_string = false ; $ len = strlen ( $ cmd ) ; $ crr_prm = "" ; $ command_str = $ cmd ; $ cmd = array ( ) ; for ( $ i = 0 ; $ len > $ i ; $ i ++ ) { $ char = $ command_str [ $ i ] ; switch ( $ char ) { case ' ' :... | Parse an command and execute console style |
6,872 | public static function run ( $ controller , $ action = null , $ params = array ( ) ) { CCFile :: enable_infos ( ) ; if ( empty ( $ action ) ) { $ action = 'default' ; } $ path = CCPath :: get ( $ controller , CCDIR_CONSOLE , EXT ) ; if ( ! file_exists ( $ path ) ) { if ( ! CCPath :: contains_namespace ( $ controller ) ... | Run a console script |
6,873 | public function _execute ( $ action , $ params = array ( ) ) { if ( method_exists ( $ this , 'action_' . $ action ) ) { call_user_func ( array ( $ this , 'action_' . $ action ) , $ params ) ; } else { CCCli :: line ( "There is no action {$action}." , 'red' ) ; } } | execute the controller |
6,874 | public function action_help ( $ params ) { if ( method_exists ( $ this , 'help' ) ) { CCCli :: line ( $ this -> help_formatter ( $ this -> help ( ) ) ) ; return ; } CCCli :: line ( 'This console controller does not implement an help function or action.' , 'cyan' ) ; } | default help action |
6,875 | public static function create ( $ name = null , $ file = null , $ url = null ) { return new static ( $ name , $ file , $ url ) ; } | Create a new InstallScript Element |
6,876 | protected function _dataTooltip ( array $ options , $ tooltip ) { if ( Arr :: key ( 'title' , $ options ) ) { $ options [ 'data-tooltip' ] = $ options [ 'title' ] ; } if ( is_string ( $ tooltip ) ) { $ options [ 'data-tooltip' ] = $ tooltip ; } return $ options ; } | Setup tooltip data - tooltip attr . |
6,877 | protected function _prepareBtn ( Helper $ helper , array $ options , $ button ) { $ options = $ helper -> addClass ( $ options , 'waves-effect waves-light btn' ) ; if ( ! empty ( $ button ) ) { $ options = $ helper -> addClass ( $ options , Str :: trim ( ( string ) $ button ) ) ; } return $ options ; } | Prepare form buttons . |
6,878 | protected function _prepareTooltip ( Helper $ helper , array $ options , $ tooltip ) { $ _options = [ 'data-position' => 'top' ] ; if ( Arr :: key ( 'tooltipPos' , $ options ) ) { $ _options [ 'data-position' ] = ( string ) $ options [ 'tooltipPos' ] ; unset ( $ options [ 'tooltipPos' ] ) ; } $ options = $ this -> _too... | Prepare tooltip attrs . |
6,879 | protected function _tooltipTitle ( array $ options , $ tooltip ) { if ( $ tooltip === true && ! Arr :: key ( 'title' , $ options ) ) { $ options [ 'title' ] = strip_tags ( $ options [ 'label' ] ) ; } if ( is_string ( $ tooltip ) ) { $ options [ 'title' ] = $ tooltip ; } return $ options ; } | Setup tooltip title . |
6,880 | public function action_build ( $ params ) { $ test_directories = array ( ) ; if ( is_dir ( APPPATH . CCDIR_TEST ) ) { $ this -> line ( 'found tests in your application.' ) ; $ test_directories [ 'App' ] = APPPATH . CCDIR_TEST ; } if ( $ params [ '-include-core' ] ) { $ test_directories [ 'Core' ] = COREPATH . '../' . C... | Builds the phpunit . xml file |
6,881 | public function setDataWithKeys ( Array $ keys , $ value ) { $ data = & $ this -> data ; if ( $ keys === array ( ) ) { if ( ! is_array ( $ value ) ) { throw new DataInputException ( 'Wenn $keys leer ist, darf value nur ein array sein!' ) ; } return $ data = $ value ; } $ lastKey = array_pop ( $ keys ) ; foreach ( $ key... | Setzt einen Wert mit einem Pfad |
6,882 | public function set ( $ keys , $ value ) { if ( is_string ( $ keys ) ) $ keys = explode ( '.' , $ keys ) ; if ( is_integer ( $ keys ) ) $ keys = array ( $ keys ) ; return $ this -> setDataWithKeys ( $ keys , $ value ) ; } | Setzt einen Wert in den Daten |
6,883 | public function strategy ( $ strategy = null ) { if ( is_null ( $ strategy ) ) { $ strategy = $ this -> defaultStrategy ? : OrderStrategy :: class ; } if ( ! class_exists ( $ strategy ) ) { $ strategy = __NAMESPACE__ . '\strategies\\' . ucfirst ( $ strategy ) ; } if ( ! class_exists ( $ strategy ) ) { throw new Invalid... | Get a strategy instance . |
6,884 | public function get ( $ id , $ throwException = true ) { if ( isset ( $ this -> _gateways [ $ id ] ) ) { return $ this -> _gateways [ $ id ] ; } if ( isset ( $ this -> _definitions [ $ id ] ) ) { $ definition = $ this -> _definitions [ $ id ] ; if ( is_object ( $ definition ) && ! $ definition instanceof Closure ) { re... | Returns the gateway instance with the specified ID . |
6,885 | public function set ( $ id , $ definition ) { unset ( $ this -> _gateways [ $ id ] ) ; if ( $ definition === null ) { unset ( $ this -> _definitions [ $ id ] ) ; return ; } if ( is_object ( $ definition ) || is_callable ( $ definition , true ) ) { $ this -> _definitions [ $ id ] = $ definition ; } elseif ( is_array ( $... | Registers a gateway definition with this locator . |
6,886 | public function setGateways ( $ gateways ) { foreach ( $ gateways as $ id => $ gateway ) { $ this -> set ( $ id , $ gateway ) ; } } | Registers a set of gateway definitions in this locator . |
6,887 | protected function doGetInjectedDefinitions ( $ name , array & $ visited ) { if ( isset ( $ visited [ $ name ] ) ) { return ; } try { $ visited [ $ name ] = $ this -> proxy -> get ( $ name ) ; } catch ( RuntimeException $ e ) { return ; } catch ( MissingPropertyException $ e ) { return ; } foreach ( $ visited [ $ name ... | Recursively looks for discovered dependencies |
6,888 | public function getFilter ( ) { $ filter = [ ] ; $ tag = $ this -> getRequest ( ) -> getVar ( "t" ) ; if ( $ tag ) { $ filter [ "Tags.URLSegment" ] = $ tag ; } $ this -> extend ( "updateFilter" , $ filter ) ; return $ filter ; } | Find a filter from the URL that we can apply to the products list |
6,889 | public function PaginatedProducts ( $ limit = 10 ) { $ products = $ this -> SortedProducts ( ) ; $ filter = $ this -> getFilter ( ) ; if ( count ( $ filter ) ) { $ products = $ products -> filter ( $ filter ) ; } return PaginatedList :: create ( $ products , $ this -> getRequest ( ) ) -> setPageLength ( $ limit ) ; } | Get a paginated list of products contained in this category |
6,890 | public function PaginatedAllProducts ( $ limit = 10 ) { $ products = $ this -> AllProducts ( ) ; $ filter = $ this -> getFilter ( ) ; if ( count ( $ filter ) ) { $ products = $ products -> filter ( $ filter ) ; } return PaginatedList :: create ( $ products , $ this -> getRequest ( ) ) -> setPageLength ( $ limit ) ; } | Get a paginated list of all products at this level and below |
6,891 | public function getViewer ( $ action ) { if ( isset ( $ this -> templates [ $ action ] ) && $ this -> templates [ $ action ] || ( isset ( $ this -> templates [ 'index' ] ) && $ this -> templates [ 'index' ] ) || $ this -> template ) { return parent :: getViewer ( $ action ) ; } if ( $ action == "index" ) { $ action = "... | Overwrite default SSViewer call to get a custom template list |
6,892 | protected function alert ( \ AMQP \ Wire \ Reader $ args ) { $ replyCode = $ args -> readShort ( ) ; $ replyText = $ args -> readShortstr ( ) ; $ details = $ args -> readTable ( ) ; array_push ( $ this -> alerts , array ( $ replyCode , $ replyText , $ details ) ) ; } | This method allows the server to send a non - fatal warning to the client . This is used for methods that are normally asynchronous and thus do not have confirmations and for which the server may detect errors that need to be reported . Fatal errors are handled as channel or connection exceptions ; non - fatal errors a... |
6,893 | protected function accessRequestOk ( \ AMQP \ Wire \ Reader $ args ) { $ this -> defaultTicket = $ args -> readShort ( ) ; return $ this -> defaultTicket ; } | grant access to server resources |
6,894 | protected function queueDeclareOk ( \ AMQP \ Wire \ Reader $ args ) { $ queue = $ args -> readShortstr ( ) ; $ messageCount = $ args -> readLong ( ) ; $ consumerCount = $ args -> readLong ( ) ; return array ( $ queue , $ messageCount , $ consumerCount ) ; } | confirms a queue definition |
6,895 | public function basicCancel ( $ consumerTag , $ nowait = false ) { $ args = $ this -> frameBuilder -> basicCancel ( $ consumerTag , $ nowait ) ; $ this -> sendMethodFrame ( array ( 60 , 30 ) , $ args ) ; return $ this -> wait ( array ( "60,31" ) ) ; } | end a queue consumer |
6,896 | public function basicQos ( $ prefetchSize , $ prefetchCount , $ aGlobal ) { $ args = $ this -> frameBuilder -> basicQos ( $ prefetchSize , $ prefetchCount , $ aGlobal ) ; $ this -> sendMethodFrame ( array ( 60 , 10 ) , $ args ) ; return $ this -> wait ( array ( "60,11" ) ) ; } | specify quality of service |
6,897 | public function basicRecover ( $ reQueue = false ) { $ args = $ this -> frameBuilder -> basicRecover ( $ reQueue ) ; $ this -> sendMethodFrame ( array ( 60 , 100 ) , $ args ) ; } | redeliver unacknowledged messages |
6,898 | public function basicReject ( $ deliveryTag , $ reQueue ) { $ args = $ this -> frameBuilder -> basicReject ( $ deliveryTag , $ reQueue ) ; $ this -> sendMethodFrame ( array ( 60 , 90 ) , $ args ) ; } | reject an incoming message |
6,899 | protected function basicReturn ( \ AMQP \ Wire \ Reader $ args ) { $ reply_code = $ args -> readShort ( ) ; $ reply_text = $ args -> readShortstr ( ) ; $ exchange = $ args -> readShortstr ( ) ; $ routing_key = $ args -> readShortstr ( ) ; $ msg = $ this -> wait ( ) ; } | return a failed message |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.