idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
15,200 | protected function populatePreviousData ( Form $ form ) { $ prepops = EventAttendee :: config ( ) -> prepopulated_fields ; if ( ! $ prepops ) { return ; } $ latestattendee = $ this -> registration -> Attendees ( ) -> sort ( "LastEdited" , "DESC" ) -> first ( ) ; if ( $ latestattendee ) { $ form -> loadDataFrom ( $ late... | poplate given form with specfific data from last attednee |
15,201 | public function edit ( $ request ) { $ attendee = $ this -> registration -> Attendees ( ) -> byID ( $ request -> param ( 'ID' ) ) ; if ( ! $ attendee ) { return $ this -> httpError ( 404 , "Attendee not found" ) ; } $ form = $ this -> AttendeeForm ( ) ; $ ticket = $ attendee -> Ticket ( ) ; if ( ! $ ticket -> exists ( ... | Edit action renders the attendee form populated with existing details . |
15,202 | public function save ( $ data , $ form ) { $ attendeeid = $ form -> Fields ( ) -> fieldByName ( "ID" ) -> dataValue ( ) ; $ attendee = $ this -> registration -> Attendees ( ) -> byID ( ( int ) $ attendeeid ) ; if ( $ attendee && $ attendee -> TicketID && $ attendee -> TicketID != $ data [ 'TicketID' ] ) { $ form -> ses... | Save new and edited attendees |
15,203 | protected function createAttendee ( ) { $ attendee = EventAttendee :: create ( ) ; $ attendee -> RegistrationID = $ this -> registration -> ID ; return $ attendee ; } | Helper for creating new attendee on registration . |
15,204 | public static function convertGDRessourceToImagick ( $ imgRessource , $ png = false ) { ob_start ( ) ; if ( $ png ) { imagepng ( $ imgRessource , null , 0 ) ; } else { imagejpeg ( $ imgRessource , null , 100 ) ; } $ blob = ob_get_clean ( ) ; $ image = new \ Imagick ( ) ; $ image -> readImageBlob ( $ blob ) ; return $ i... | Convertit une ressource image GD en objet Imagick |
15,205 | public static function convertImagickToGDRessource ( \ Imagick $ imagick , $ png = false ) { $ imagick -> setImageFormat ( 'png' ) ; $ data = $ imagick -> getimageblob ( ) ; $ im = imagecreatefromstring ( $ data ) ; if ( $ png ) { imagealphablending ( $ im , true ) ; imagesavealpha ( $ im , true ) ; } return $ im ; } | Convertir un objet Imagick en ressource image GD |
15,206 | public static function setEvents ( $ pEvents = NULL ) { if ( $ pEvents === NULL ) { $ pEvents = Agl :: app ( ) -> getConfig ( 'main/events' ) ; } if ( is_array ( $ pEvents ) ) { self :: $ _events = $ pEvents ; } else { self :: $ _events = array ( ) ; } return self :: $ _events ; } | Register events . Get events from the configuration by default . |
15,207 | public function findElementtypeByUniqueId ( $ uniqueId ) { foreach ( $ this -> elementtypeManager -> findAll ( ) as $ elementtype ) { if ( $ elementtype -> getUniqueId ( ) === $ uniqueId ) { return $ elementtype ; } } return null ; } | Find element type by unique id . |
15,208 | public function findElementtypeByType ( $ type ) { $ elementtypes = [ ] ; foreach ( $ this -> elementtypeManager -> findAll ( ) as $ elementtype ) { if ( $ elementtype -> getType ( ) === $ type ) { $ elementtypes [ ] = $ elementtype ; } } return $ elementtypes ; } | Find element type by type . |
15,209 | public function createElementtype ( $ type , $ uniqueId , $ name , $ icon , ElementtypeStructure $ elementtypeStructure = null , array $ mappings = null , $ user , $ flush = true ) { if ( ! $ icon ) { $ icons = [ Elementtype :: TYPE_FULL => 'artikel_list.gif' , Elementtype :: TYPE_STRUCTURE => 'nav_haupt.gif' , Element... | Create a new empty Element Type . |
15,210 | public function duplicateElementtype ( Elementtype $ sourceElementtype , $ user ) { $ elementtype = clone $ sourceElementtype ; $ uniqId = uniqid ( ) ; foreach ( $ elementtype -> getTitles ( ) as $ language => $ title ) { $ elementtype -> setTitle ( $ language , $ title . ' - copy - ' . $ uniqId ) ; } $ elementtypeStru... | Duplicate an elementtype . |
15,211 | public function parseIntelligent ( $ value ) { $ functions = [ "parseNumeric" , "parseBoolean" , "parseString" ] ; foreach ( $ functions as $ function ) { try { return call_user_func ( [ $ this , $ function ] , $ value ) ; } catch ( ParseException $ e ) { } } $ exportValue = var_export ( $ value , true ) ; throw new Pa... | Gets a raw value land tries to parse it in several ways . When it found a function that can parse the given value it will return immediately instead of trying to parse it with one of the possible functions left . |
15,212 | public function parseNumeric ( $ value ) { if ( is_numeric ( $ value ) ) { return $ value + 0 ; } $ exportValue = var_export ( $ value , true ) ; throw new ParseException ( "'$exportValue' could not be parsed as a number" ) ; } | Make this numeric element a number of the correct type . |
15,213 | public function parseString ( $ value ) { if ( is_string ( $ value ) ) { return $ value ; } $ exportValue = var_export ( $ value , true ) ; throw new ParseException ( "'$exportValue' can not be parsed as a string" ) ; } | Tests if the given value is of type string |
15,214 | public function getResultObject ( array $ result_array ) { $ result_object = array ( ) ; foreach ( $ result_array as $ key => $ value ) { $ result_object [ ] = ( object ) $ value ; } return ( object ) $ result_object ; } | This method sets the resultset in object format |
15,215 | public function getClient ( ) { if ( $ this -> client ) { return $ this -> client ; } $ this -> client = new Client ( self :: BASE_URL ) ; return $ this -> client ; } | Get the client used to query Pocket . |
15,216 | public function findRelatedIssuesByRepository ( RepositoryInterface $ repository , $ shortName , $ numericId ) { $ repositoryIds = [ ] ; foreach ( $ repository -> getProjects ( ) as $ project ) { $ repositoryIds [ ] = $ project -> getId ( ) ; } $ queryBuilder = $ this -> repository -> createQueryBuilder ( 'i' ) -> left... | Finds related issues of repository short name and numeric id given . |
15,217 | public function tick ( $ class , array $ params = array ( ) , $ usernameid = NULL , $ decrement = false ) { if ( empty ( $ class ) ) : return false ; endif ; $ handler = new File ( ) ; $ file = date ( "Y-m-d" ) . ".log" ; $ folder = PATH_LOGS . DS . $ class . DS ; if ( ! $ handler -> isFile ( $ folder . $ file ) ) { if... | Ticks a user performed action |
15,218 | protected function identity ( ) { if ( null === $ this -> identity ) { $ authenticationService = $ this -> getServiceLocator ( ) -> get ( 'Zend\Authentication\AuthenticationService' ) ; if ( ! $ authenticationService -> hasIdentity ( ) ) { throw new \ Exception ( 'No identity loaded' ) ; } $ this -> identity = $ authen... | Get the current identity |
15,219 | protected function save ( $ successMessage , $ failureMessage ) { try { $ this -> getEntityManager ( ) -> flush ( ) ; $ this -> addMessage ( $ successMessage , FlashMessenger :: NAMESPACE_SUCCESS ) ; return true ; } catch ( \ Exception $ e ) { $ this -> addMessage ( $ failureMessage , FlashMessenger :: NAMESPACE_ERROR ... | Flush the entityManager and handle errors |
15,220 | public function createAction ( Request $ request ) { $ entity = new Collection ( ) ; $ form = $ this -> createCreateForm ( $ entity ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ entity ) ; $ em -> flush ( ) ; return $ ... | Creates a new Collection entity . |
15,221 | private function createCreateForm ( Collection $ entity ) { $ form = $ this -> createForm ( $ this -> get ( 'amulen.classification.form.collection' ) , $ entity , array ( 'action' => $ this -> generateUrl ( 'admin_collection_create' ) , 'method' => 'POST' , ) ) ; $ form -> add ( 'submit' , 'submit' , array ( 'label' =>... | Creates a form to create a Collection entity . |
15,222 | public function newAction ( ) { $ entity = new Collection ( ) ; $ form = $ this -> createCreateForm ( $ entity ) ; return array ( 'entity' => $ entity , 'form' => $ form -> createView ( ) , ) ; } | Displays a form to create a new Collection entity . |
15,223 | public function addInterceptors ( array $ interceptors ) { foreach ( $ interceptors as $ interceptor ) { if ( $ interceptor instanceof HandlerInterceptor ) { array_push ( $ this -> interceptors , $ interceptor ) ; } } } | Add a list of HandlerInterceptor instances to the end of this chain |
15,224 | public function applyPreHandle ( ServletRequestInterface $ request , ServletResponseInterface $ response ) { $ interceptors = $ this -> getInterceptors ( ) ; if ( ! empty ( $ interceptors ) ) { for ( $ i = 0 ; $ i < count ( $ interceptors ) ; $ i ++ ) { $ interceptor = $ interceptors [ $ i ] ; if ( ! $ interceptor -> p... | Apply preHandle methods of registered interceptors |
15,225 | public function applyPostHandle ( ServletRequestInterface $ request , ServletResponseInterface $ response , ModelAndView $ model ) { $ interceptors = $ this -> getInterceptors ( ) ; if ( ! empty ( $ interceptors ) ) { for ( $ i = $ this -> interceptorIndex ; $ i >= 0 ; $ i -- ) { $ interceptor = $ interceptors [ $ i ] ... | Applies postHandle methods of registered interceptors |
15,226 | public function triggerAfterCompletion ( ServletRequestInterface $ request , ServletResponseInterface $ response , \ Exception $ ex ) { $ interceptors = $ this -> getInterceptors ( ) ; if ( ! empty ( $ interceptors ) ) { for ( $ i = $ this -> interceptorIndex ; $ i >= 0 ; $ i -- ) { $ interceptor = $ interceptors [ $ i... | Applies afterCompletion methods of registered interceptors |
15,227 | public function getConnectionString ( ) { $ connection_string = array ( ) ; $ type = $ this -> getType ( ) ; array_push ( $ connection_string , $ type ) ; if ( $ type == self :: SQLite ) { $ filename = 'db.sqlite' ; if ( isset ( $ this -> properties [ 'filename' ] ) ) $ filename = $ this -> properties [ 'filename' ] ; ... | ritorna la stringa di connessione per interfaccia pdo |
15,228 | public function execute ( ) { $ query = $ this -> factory -> builder ( $ this -> insert ) -> process ( ) ; $ result = $ this -> pdo -> query ( $ query ) ; if ( ! $ result ) { throw new \ Exception ( 'An error is while the insertion occurred! (query: "' . $ query . '")' ) ; } return $ this -> pdo -> lastInsertId ( ) ; } | Execute the query and insert the expected entries in the database . |
15,229 | public function columns ( array $ columns ) { $ columnsArray = array ( ) ; foreach ( $ columns as $ column ) { $ columnsArray [ ] = $ this -> factory -> references ( 'Column' , $ column ) ; } $ this -> insert -> columns ( $ columnsArray ) ; return $ this ; } | Set columns to the query in which should insert new entries . Afterwards the value method should call to set the values . |
15,230 | public function values ( array $ values ) { $ valuesArray = array ( ) ; foreach ( $ values as $ value ) { $ valuesArray [ ] = $ this -> factory -> references ( 'Value' , $ value ) ; } $ this -> insert -> values ( $ valuesArray ) ; return $ this ; } | Set values to the query . The method can execute multiple times . The passed array require the same amount of elements otherwise an exception will thrown . |
15,231 | protected function renderTemplate ( ConfigGroup $ group = null ) { $ adminPool = $ this -> container -> get ( 'sonata.admin.pool' ) ; return $ this -> render ( 'VinceTAdminConfigurationBundle:Configuration:index.html.twig' , array ( 'configuration_menu' => $ this -> createMenu ( ) , 'group' => $ group , 'form' => $ thi... | Render the main template |
15,232 | protected function createConfigGroupForm ( ConfigGroup $ group = null ) { $ formBuilder = $ this -> createFormBuilder ( ) ; if ( $ group ) { $ values = $ this -> container -> get ( 'admin.configuration.configvalue_manager' ) -> getRepository ( ) -> findByConfigGroupId ( $ group -> getId ( ) ) ; foreach ( $ values as $ ... | Create the form for all values in group |
15,233 | private function generateRolesAndPermissions ( ) { if ( empty ( $ this -> aclData ) ) { $ this -> error ( 'empty roles and permissions in "generateRolesAndPermissions" method' ) ; return ; } foreach ( $ this -> aclData as $ acl ) { $ this -> createPermissions ( $ acl [ 'acl' ] ) ; $ this -> createRoles ( $ acl [ 'acl' ... | Create roles permissions and roles_permissions |
15,234 | private function createRolesPermissions ( array $ aclData ) { $ allRolesActions = $ this -> extractAllActions ( $ aclData ) ; $ uncheckedActionsOutput = [ ] ; foreach ( $ this -> rolesList as $ roleRecord ) { $ roleRecord -> load ( 'permissions' ) ; $ currentRolePermissions = $ roleRecord -> permissions -> pluck ( 'act... | Creating roles permissions |
15,235 | public function addResource ( ResourceInterface $ resource ) { if ( ! $ this -> trackResources ) { return $ this ; } $ this -> resources [ ] = $ resource ; return $ this ; } | Adds a resource for this configuration . |
15,236 | public function addClassResource ( \ ReflectionClass $ class ) { if ( ! $ this -> trackResources ) { return $ this ; } do { if ( is_file ( $ class -> getFileName ( ) ) ) { $ this -> addResource ( new FileResource ( $ class -> getFileName ( ) ) ) ; } } while ( $ class = $ class -> getParentClass ( ) ) ; return $ this ; ... | Adds the given class hierarchy as resources . |
15,237 | public function resolveServices ( $ value ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ k => $ v ) { $ value [ $ k ] = $ this -> resolveServices ( $ v ) ; } } elseif ( $ value instanceof Reference ) { $ value = $ this -> get ( ( string ) $ value , $ value -> getInvalidBehavior ( ) ) ; } elseif ( $ value inst... | Replaces service references by the real service instance and evaluates expressions . |
15,238 | protected function runJob ( ) { if ( isset ( $ this -> callbackChildren [ $ this -> uid ] ) ) { $ callback = $ this -> callbackChildren [ $ this -> uid ] ; $ result = $ callback -> call ( $ this -> callbackParamChildren [ $ this -> uid ] ) ; } else if ( $ this -> callback ) { $ result = $ this -> callback -> call ( $ t... | Run the fork job |
15,239 | public function doTheJob ( $ callback , $ params = array ( ) ) { if ( ! $ callback instanceof CallbackHandler ) { $ callback = new CallbackHandler ( $ callback ) ; } if ( ! is_array ( $ params ) ) { $ params = array ( $ params ) ; } $ this -> callback = $ callback ; $ this -> callbackParam = $ params ; return $ this ; ... | Set default jobs |
15,240 | public function doTheJobChild ( $ num , $ callback , $ params = array ( ) ) { if ( ! $ callback instanceof CallbackHandler ) { $ callback = new CallbackHandler ( $ callback ) ; } if ( ! is_array ( $ params ) ) { $ params = array ( $ params ) ; } $ this -> callbackChildren [ $ num ] = $ callback ; $ this -> callbackPara... | Set cild jobs |
15,241 | public function handler ( $ signal ) { switch ( $ signal ) { case SIGALRM : $ this -> isStopped = true ; $ this -> closeChildren ( ) ; break ; case SIGINT : case SIGKILL : $ this -> broadcast ( $ signal ) ; exit ; default : break ; } } | ISignal handler . |
15,242 | public function getSharedResults ( ) { if ( ! $ this -> shareResult ) { return false ; } if ( ! $ this -> isStarted ) { return false ; } if ( ! $ this -> isFinished ) { trigger_error ( 'children process was not interrupted' , E_USER_NOTICE ) ; return false ; } $ resultsContainer = $ this -> getDefaultResultsContainer (... | Close all children |
15,243 | public function setShareResult ( $ b ) { if ( $ this -> isStarted ) { throw new Exception \ RuntimeException ( 'Invalid timeout value' ) ; } $ this -> shareResult = $ b ; return $ this ; } | Set flag to share result |
15,244 | public function addProvider ( $ provider ) { if ( is_string ( $ provider ) ) { $ provider = new $ provider ( $ this ) ; } if ( in_array ( $ provider , $ this -> providers ) ) { return ; } $ this -> providers [ ] = $ provider ; $ this -> registerEvents ( $ provider ) ; $ this -> registerProvides ( $ provider ) ; $ this ... | Add a service provider to the application . |
15,245 | public function registerProvidersFor ( $ binding ) { foreach ( $ this -> provides ( $ binding ) as $ provider ) { $ this -> registerProvider ( $ provider , true , $ binding ) ; } } | Register the service providers for a specific binding |
15,246 | protected function registerEvents ( ServiceProvider $ provider ) { if ( ! isset ( $ this -> event ) ) return ; foreach ( $ provider -> when ( ) as $ event ) { $ this -> event -> listen ( $ event , function ( ) use ( $ provider ) { $ this -> registerProvider ( $ provider , true ) ; } ) ; } } | Register the events that register the specified provider |
15,247 | protected function registerProvides ( ServiceProvider $ provider ) { foreach ( $ provider -> provides ( ) as $ binding ) { $ this -> provides [ $ binding ] [ ] = $ provider ; } } | Remember the bindings that the specified service provider provides |
15,248 | public function refreshToken ( AccessToken $ accessToken ) { $ refreshToken = $ accessToken -> getRefreshToken ( ) ; $ scope = $ accessToken -> getScope ( ) ; if ( empty ( $ refreshToken ) ) { throw new RuntimeException ( 'No refresh token was set' ) ; } $ data = array ( 'grant_type' => 'refresh_token' , 'refresh_token... | Tries to refresh an access token if an refresh token is available . Returns the new received access token or throws an excepion |
15,249 | protected static function _setPhpInit ( ) { $ init = Module :: merge ( ptc_path ( 'root' ) . '/app/config/init.php' ) ; foreach ( $ init as $ k => $ v ) { if ( is_array ( $ v ) ) { foreach ( $ v as $ key => $ val ) { ini_set ( $ k . '.' . $ key , $ val ) ; } } else { ini_set ( $ k , $ v ) ; } } static :: option ( 'init... | Php configuration at runtime |
15,250 | protected static function _setDebug ( ) { $ debug = Module :: merge ( ptc_path ( 'root' ) . '/app/config/debug.php' ) ; if ( file_exists ( ptc_path ( 'root' ) . '/app/config/debug_ajax.php' ) ) { if ( ! empty ( $ _SERVER [ 'HTTP_X_REQUESTED_WITH' ] ) && ( 'xmlhttprequest' === strtolower ( $ _SERVER [ 'HTTP_X_REQUESTED_... | Set debug at runtime |
15,251 | protected static function _setAppConfig ( ) { static :: option ( 'paths' , Module :: merge ( ptc_path ( 'root' ) . '/app/config/paths.php' ) ) ; ptc_add_path ( ptc_array_get ( static :: $ _config , 'paths' ) ) ; static :: option ( 'app' , Module :: merge ( ptc_path ( 'root' ) . '/app/config/app.php' ) ) ; HandyMan :: a... | Application bootstrap configuration |
15,252 | protected static function _setCustomConfigFiles ( ) { $ files = array ( '..' , '.' , 'app.php' , 'db.php' , 'debug.php' , 'init.php' , 'modules.php' , 'paths.php' , 'auth.php' , 'debug_ajax.php' ) ; $ scanned_directory = array_diff ( scandir ( ptc_path ( 'root' ) . '/app/config' ) , $ files ) ; if ( ! empty ( $ scanned... | Load custom config files |
15,253 | protected static function _loadModulesConfig ( ) { $ config = array ( '..' , '.' ) ; foreach ( static :: options ( ) as $ key => $ val ) { $ config [ ] = $ key . '.php' ; } foreach ( Module :: all ( ) as $ k => $ module ) { $ scanned_directory = array_diff ( scandir ( ptc_path ( 'root' ) . '/modules/' . $ k . '/config'... | Load module config files that are not in root config |
15,254 | public function createDelegatorWithName ( ServiceLocatorInterface $ serviceLocator , $ name , $ requestedName , $ callback ) { $ oauth2Server = $ callback ( ) ; if ( is_callable ( $ oauth2Server ) ) { $ oauth2ServerFactory = $ oauth2Server ; $ oauth2Server = $ oauth2ServerFactory ( ) ; } $ moduleOptions = $ serviceLoca... | A factory that creates delegates of a given service |
15,255 | public function initStructureNodeParentsRelatedByStructureNodeId ( $ overrideExisting = true ) { if ( null !== $ this -> collStructureNodeParentsRelatedByStructureNodeId && ! $ overrideExisting ) { return ; } $ this -> collStructureNodeParentsRelatedByStructureNodeId = new ObjectCollection ( ) ; $ this -> collStructure... | Initializes the collStructureNodeParentsRelatedByStructureNodeId collection . |
15,256 | public function initStructureNodeParentsRelatedByParentId ( $ overrideExisting = true ) { if ( null !== $ this -> collStructureNodeParentsRelatedByParentId && ! $ overrideExisting ) { return ; } $ this -> collStructureNodeParentsRelatedByParentId = new ObjectCollection ( ) ; $ this -> collStructureNodeParentsRelatedByP... | Initializes the collStructureNodeParentsRelatedByParentId collection . |
15,257 | public function getKstruktur ( ConnectionInterface $ con = null ) { if ( $ this -> singleKstruktur === null && ! $ this -> isNew ( ) ) { $ this -> singleKstruktur = ChildKstrukturQuery :: create ( ) -> findPk ( $ this -> getPrimaryKey ( ) , $ con ) ; } return $ this -> singleKstruktur ; } | Gets a single ChildKstruktur object which is related to this object by a one - to - one relationship . |
15,258 | public function setKstruktur ( ChildKstruktur $ v = null ) { $ this -> singleKstruktur = $ v ; if ( $ v !== null && $ v -> getStructureNode ( null , false ) === null ) { $ v -> setStructureNode ( $ this ) ; } return $ this ; } | Sets a single ChildKstruktur object as related to this object by a one - to - one relationship . |
15,259 | public function getFunctionPhase ( ConnectionInterface $ con = null ) { if ( $ this -> singleFunctionPhase === null && ! $ this -> isNew ( ) ) { $ this -> singleFunctionPhase = ChildFunctionPhaseQuery :: create ( ) -> findPk ( $ this -> getPrimaryKey ( ) , $ con ) ; } return $ this -> singleFunctionPhase ; } | Gets a single ChildFunctionPhase object which is related to this object by a one - to - one relationship . |
15,260 | public function setFunctionPhase ( ChildFunctionPhase $ v = null ) { $ this -> singleFunctionPhase = $ v ; if ( $ v !== null && $ v -> getStructureNode ( null , false ) === null ) { $ v -> setStructureNode ( $ this ) ; } return $ this ; } | Sets a single ChildFunctionPhase object as related to this object by a one - to - one relationship . |
15,261 | public function initStructureNodesRelatedByParentId ( ) { $ this -> collStructureNodesRelatedByParentId = new ObjectCollection ( ) ; $ this -> collStructureNodesRelatedByParentIdPartial = true ; $ this -> collStructureNodesRelatedByParentId -> setModel ( '\gossi\trixionary\model\StructureNode' ) ; } | Initializes the collStructureNodesRelatedByParentId crossRef collection . |
15,262 | public function removeStructureNodeRelatedByParentId ( ChildStructureNode $ structureNodeRelatedByParentId ) { if ( $ this -> getStructureNodesRelatedByParentId ( ) -> contains ( $ structureNodeRelatedByParentId ) ) { $ structureNodeParent = new ChildStructureNodeParent ( ) ; $ structureNodeParent -> setStructureNodeRe... | Remove structureNodeRelatedByParentId of this object through the kk_trixionary_structure_node_parent cross reference table . |
15,263 | public function initStructureNodesRelatedByStructureNodeId ( ) { $ this -> collStructureNodesRelatedByStructureNodeId = new ObjectCollection ( ) ; $ this -> collStructureNodesRelatedByStructureNodeIdPartial = true ; $ this -> collStructureNodesRelatedByStructureNodeId -> setModel ( '\gossi\trixionary\model\StructureNod... | Initializes the collStructureNodesRelatedByStructureNodeId crossRef collection . |
15,264 | public function removeStructureNodeRelatedByStructureNodeId ( ChildStructureNode $ structureNodeRelatedByStructureNodeId ) { if ( $ this -> getStructureNodesRelatedByStructureNodeId ( ) -> contains ( $ structureNodeRelatedByStructureNodeId ) ) { $ structureNodeParent = new ChildStructureNodeParent ( ) ; $ structureNode... | Remove structureNodeRelatedByStructureNodeId of this object through the kk_trixionary_structure_node_parent cross reference table . |
15,265 | public function getChildObject ( ) { if ( ! $ this -> hasChildObject ( ) ) { return null ; } $ childObjectClass = $ this -> getDescendantClass ( ) ; $ childObject = PropelQuery :: from ( $ childObjectClass ) -> findPk ( $ this -> getPrimaryKey ( ) ) ; return $ childObject -> hasChildObject ( ) ? $ childObject -> getChi... | Get the child object of this object |
15,266 | public function initController ( \ OWeb \ types \ Controller $ controller = null ) { if ( $ this -> controller == null ) return ; Events :: getInstance ( ) -> sendEvent ( 'Init_Prepare@OWeb\manage\Controller' , $ this -> controller ) ; $ this -> controller -> initController ( ) ; Events :: getInstance ( ) -> sendEvent ... | Will initialize the Controller and will do the Actions to which the Controller has register |
15,267 | public function loadController ( $ name ) { if ( $ this -> controller != null ) { throw new \ OWeb \ manage \ exceptions \ Controller ( "A Controller was already loaded" ) ; } else { try { $ controller = new $ name ( true ) ; $ this -> controller = $ controller ; if ( ! ( $ controller instanceof \ OWeb \ types \ Contro... | Will load the Controller as main controller . Will automaticlly set up the initialisation sequence for the Controller . The Controller will be initialized once OWeb has finished initialisation . |
15,268 | public function display ( ) { if ( $ this -> controller != null ) { try { $ this -> controller -> display ( ) ; } catch ( \ Exception $ ex ) { throw new \ OWeb \ manage \ exceptions \ Controller ( "The Controller couldn't be shown due to Errors" , 0 , $ ex ) ; } } else { throw new \ OWeb \ manage \ exceptions \ Control... | Will start the display sequence of the controller . First will prepare controller for display . Then it will ask the controller to display it s View . |
15,269 | public function generateRandomKey ( int $ length = 32 ) : string { if ( $ length < 1 ) { throw new \ RuntimeException ( 'First parameter ($length) must be greater than 0' ) ; } if ( \ function_exists ( 'random_bytes' ) ) { return \ random_bytes ( $ length ) ; } throw new \ RuntimeException ( 'Function random_bytes not ... | Generates specified number of random bytes . Note that output may not be ASCII . |
15,270 | public static function verifyFormatting ( $ p_address ) { if ( strstr ( $ p_address , "@" ) == false ) { return false ; } else { list ( $ user , $ domain ) = explode ( '@' , $ p_address ) ; if ( strstr ( $ domain , '.' ) == false ) { return false ; } else { return true ; } } } | Verify email global format |
15,271 | public static function make ( $ string ) { $ key1 = config ( 'security.key1' ) ; $ key2 = config ( 'security.key2' ) ; return sha1 ( md5 ( $ string . 'youssef' . $ key1 ) ) . md5 ( sha1 ( $ string . 'Vinala' . $ key2 ) ) ; } | A function to create a hash string based on another string . |
15,272 | public static function create ( $ lenght ) { $ characters = 'abcdefghijk01234lmnopq56789rstuxyvwz' ; $ charLenght = strlen ( $ characters ) ; $ string = '' ; for ( $ i = 0 ; $ i < $ lenght ; $ i ++ ) { $ index = mt_rand ( 0 , $ charLenght - 1 ) ; $ string .= $ characters [ $ index ] ; } return $ string ; } | Create a hash string . |
15,273 | public function link_provider ( array $ data ) { if ( ! is_numeric ( $ data [ 'expires' ] ) ) { if ( $ date = \ DateTime :: createFromFormat ( \ DateTime :: ISO8601 , $ data [ 'expires' ] ) ) { $ data [ 'expires' ] = $ date -> getTimestamp ( ) ; } elseif ( $ date = \ DateTime :: createFromFormat ( 'Y-m-d H:i:s' , $ dat... | create a remote entry for this login |
15,274 | public function get ( $ key , $ default = null ) { return is_array ( $ this -> response ) ? \ Arr :: get ( $ this -> response , $ key , $ default ) : $ default ; } | Get a response value |
15,275 | protected function callback ( ) { $ this -> response = \ Input :: get ( 'opauth' , false ) and $ this -> response = unserialize ( base64_decode ( $ this -> response ) ) ; if ( ! $ this -> response ) { throw new \ OpauthException ( 'no valid response received in the callback' ) ; } if ( array_key_exists ( 'error' , $ th... | fetch the callback response |
15,276 | protected function create_user ( array $ user ) { $ user_id = \ Auth :: create_user ( isset ( $ user [ 'nickname' ] ) ? $ user [ 'nickname' ] : null , isset ( $ user [ 'password' ] ) ? $ user [ 'password' ] : \ Str :: random ( ) , isset ( $ user [ 'email' ] ) ? $ user [ 'email' ] : null , \ Config :: get ( 'opauth.defa... | use Auth to create a new user in case we ve received enough information to do so |
15,277 | public function addChild ( Node $ child ) { array_push ( $ this -> children , $ child ) ; $ child -> setParent ( $ this ) ; } | Adds a child to this node s content . A child may be a TextNode or another ElementNode ... or anything else that may extend the abstract Node class . |
15,278 | public function removeChild ( Node $ child ) { foreach ( $ this -> children as $ key => $ value ) { if ( $ value == $ child ) unset ( $ this -> children [ $ key ] ) ; } } | Removes a child from this node s contnet . |
15,279 | public function closestParentOfType ( $ str ) { $ str = strtolower ( $ str ) ; $ currentEl = $ this ; while ( strtolower ( $ currentEl -> getTagName ( ) ) != $ str && $ currentEl -> hasParent ( ) ) $ currentEl = $ currentEl -> getParent ( ) ; if ( strtolower ( $ currentEl -> getTagName ( ) ) != $ str ) return null ; el... | Traverses the parse tree upwards going from parent to parent until it finds a parent who has the given tag name . Returns the parent with the matching tag name if it exists otherwise returns null . |
15,280 | protected function importCSV ( $ config , $ fn = NULL ) { $ fileName = $ config [ 'fileName' ] ; $ file = fopen ( $ fileName , "r" ) ; while ( ! feof ( $ file ) ) { $ record = fgetcsv ( $ file , 0 , $ config [ 'delimiter' ] ) ; if ( isset ( $ record [ 0 ] ) ) { $ attributes = $ this -> parseAttributeMap ( $ config [ 'a... | Import a CSV file |
15,281 | private function session ( ) { if ( $ this -> session === null ) { $ this -> session = DI :: getInstance ( ) -> get ( 'session' ) ; } return $ this -> session ; } | Get the session . |
15,282 | public static function skills ( $ qty = 1 , $ max = 0 ) { if ( $ max > 0 ) { $ qty = self :: numberBetween ( $ qty , $ max ) ; } return self :: randomElements ( self :: $ skills , $ qty ) ; } | Generate fake skills from a list . |
15,283 | public function AddMatchSql ( $ Sql , $ Columns , $ LikeRelavenceColumn = '' ) { if ( $ this -> _SearchMode == 'like' ) { if ( $ LikeRelavenceColumn ) $ Sql -> Select ( $ LikeRelavenceColumn , '' , 'Relavence' ) ; else $ Sql -> Select ( 1 , '' , 'Relavence' ) ; $ Sql -> BeginWhereGroup ( ) ; $ ColumnsArray = explode ( ... | Add the sql to perform a search . |
15,284 | public function addRoute ( string $ name , array $ methods , string $ pattern , array $ middlewares , array $ handler , string $ group = null ) { $ this -> routes [ $ name ] = [ 'methods' => $ methods , 'pattern' => $ pattern , 'middlewares' => $ middlewares , 'handler' => $ handler , 'group' => $ group ] ; } | Add route to collection . |
15,285 | public function addGroup ( string $ name , string $ prefix = '' , array $ middlewares = [ ] ) { $ this -> groups [ $ name ] = [ $ prefix , $ middlewares ] ; } | Add group for routes to collection . |
15,286 | public function generateRoutesData ( RouteParser $ routeParser , DataGenerator $ dataGenerator ) { $ routes = [ ] ; foreach ( $ this -> routes as $ name => $ route ) { if ( $ route [ 'group' ] ) { if ( ! isset ( $ this -> groups [ $ route [ 'group' ] ] ) ) { throw new \ LogicException ( sprintf ( 'The route group "%s" ... | Generate routes data for FastRouter |
15,287 | protected function addToDataGenerator ( array $ methods , array $ routeDatas , string $ routeName , DataGenerator $ dataGenerator ) : DataGenerator { foreach ( $ methods as $ method ) { foreach ( $ routeDatas as $ routeData ) { $ dataGenerator -> addRoute ( $ method , $ routeData , $ routeName ) ; } } return $ dataGene... | Set route data to DataGenerator |
15,288 | public function parse ( $ data ) { $ frames = array ( ) ; while ( $ data != '' ) { $ data = $ this -> currentFrame -> parse ( $ data ) ; if ( $ data != '' ) { $ frames [ ] = $ this -> currentFrame ; $ this -> currentFrame = new Net_Notifier_WebSocket_Frame ( ) ; } } $ state = $ this -> currentFrame -> getState ( ) ; if... | Parses WebSocket frames out of a raw data stream |
15,289 | protected function formatByIntlMoneyFormatter ( $ valueToFormat = 0.0 , $ decimalsCount = NULL , $ currency = NULL ) { $ formatter = $ this -> getIntlNumberFormatter ( $ this -> langAndLocale , \ NumberFormatter :: CURRENCY , NULL , ( $ decimalsCount !== NULL ? [ \ NumberFormatter :: FRACTION_DIGITS => $ decimalsCount ... | Format money by Intl extension formatter . If no international three chars currency symbol is provided there is used currency symbol from localized Intl formatter instance . |
15,290 | public function offsetSet ( $ key , $ value ) { if ( $ key !== null ) { $ this -> data [ $ key ] = $ value ; } else { $ this -> data [ ] = $ value ; } return $ this ; } | Sets the value ArrayAccess implementation |
15,291 | public function equals ( UrlInterface $ url ) : bool { return $ this -> getScheme ( ) -> equals ( $ url -> getScheme ( ) ) && $ this -> getHost ( ) -> equals ( $ url -> getHost ( ) ) && $ this -> getPort ( ) === $ url -> getPort ( ) && $ this -> getPath ( ) -> equals ( $ url -> getPath ( ) ) && $ this -> getQueryString... | Returns true if the url equals other url false otherwise . |
15,292 | public function getHostAndPort ( ) : string { if ( $ this -> myPort !== $ this -> myScheme -> getDefaultPort ( ) ) { return $ this -> myHost . ':' . $ this -> myPort ; } return $ this -> myHost -> __toString ( ) ; } | Returns the host and port of the url as a string . |
15,293 | public function withFragment ( ? string $ fragment = null ) : UrlInterface { if ( ! self :: myValidateFragment ( $ fragment , $ error ) ) { throw new UrlInvalidArgumentException ( $ error ) ; } return new self ( $ this -> myScheme , $ this -> myHost , $ this -> myPort , $ this -> myPath , $ this -> myQueryString , $ fr... | Returns a copy of the Url instance with the specified fragment . |
15,294 | public function withHost ( HostInterface $ host ) : UrlInterface { return new self ( $ this -> myScheme , $ host , $ this -> myPort , $ this -> myPath , $ this -> myQueryString , $ this -> myFragment ) ; } | Returns a copy of the Url instance with the specified host . |
15,295 | public function withPort ( int $ port ) : UrlInterface { if ( ! self :: myValidatePort ( $ port , $ error ) ) { throw new UrlInvalidArgumentException ( $ error ) ; } return new self ( $ this -> myScheme , $ this -> myHost , $ port , $ this -> myPath , $ this -> myQueryString , $ this -> myFragment ) ; } | Returns a copy of the Url instance with the specified port . |
15,296 | public function withPath ( UrlPathInterface $ path ) : UrlInterface { return new self ( $ this -> myScheme , $ this -> myHost , $ this -> myPort , $ this -> myPath -> withUrlPath ( $ path ) , $ this -> myQueryString , $ this -> myFragment ) ; } | Returns a copy of the Url instance with the specified path . |
15,297 | public function withQueryString ( ? string $ queryString = null ) : UrlInterface { if ( ! self :: myValidateQueryString ( $ queryString , $ error ) ) { throw new UrlInvalidArgumentException ( $ error ) ; } return new self ( $ this -> myScheme , $ this -> myHost , $ this -> myPort , $ this -> myPath , $ queryString , $ ... | Returns a copy of the Url instance with the specified query string . |
15,298 | public function withScheme ( SchemeInterface $ scheme , bool $ keepDefaultPort = true ) : UrlInterface { return new self ( $ scheme , $ this -> myHost , ( $ keepDefaultPort && $ this -> myPort === $ this -> myScheme -> getDefaultPort ( ) ? $ scheme -> getDefaultPort ( ) : $ this -> myPort ) , $ this -> myPath , $ this ... | Returns a copy of the Url instance with the specified scheme . |
15,299 | public static function fromParts ( SchemeInterface $ scheme , HostInterface $ host , ? int $ port = null , UrlPathInterface $ urlPath = null , ? string $ queryString = null , ? string $ fragment = null ) { if ( $ port === null ) { $ port = $ scheme -> getDefaultPort ( ) ; } if ( $ urlPath === null ) { $ urlPath = UrlPa... | Creates a url from url parts . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.