idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
18,500 | public static function __callstatic ( $ method , array $ params ) { if ( static :: $ container ) { if ( ! isset ( $ params [ 0 ] ) ) { $ method .= '@' . $ params [ 0 ] ; } return static :: $ container -> get ( $ method ) ; } throw new NotFoundException ( Message :: get ( Message :: DI_CONTAINER_NOTFOUND ) , Message :: ... | Locate a service from the container |
18,501 | public static function initialize ( $ projectId , $ apiKey ) { if ( ! isset ( self :: $ client ) ) { self :: $ client = new Client ( $ projectId , $ apiKey ) ; } return self :: $ client ; } | Initializes the Connect client singleton instance |
18,502 | public function Add ( $ Recipient = '' ) { $ this -> Form -> SetModel ( $ this -> ConversationModel ) ; if ( $ this -> Form -> AuthenticatedPostBack ( ) ) { $ RecipientUserIDs = array ( ) ; $ To = explode ( ',' , $ this -> Form -> GetFormValue ( 'To' , '' ) ) ; $ UserModel = new UserModel ( ) ; foreach ( $ To as $ Name... | Start a new conversation . |
18,503 | public function AddMessage ( $ ConversationID = '' ) { $ this -> Form -> SetModel ( $ this -> ConversationMessageModel ) ; if ( is_numeric ( $ ConversationID ) && $ ConversationID > 0 ) $ this -> Form -> AddHidden ( 'ConversationID' , $ ConversationID ) ; if ( $ this -> Form -> AuthenticatedPostBack ( ) ) { $ Conversat... | Add a message to a conversation . |
18,504 | public function All ( $ Page = '' ) { $ Session = Gdn :: Session ( ) ; $ this -> Title ( T ( 'Inbox' ) ) ; Gdn_Theme :: Section ( 'ConversationList' ) ; list ( $ Offset , $ Limit ) = OffsetLimit ( $ Page , C ( 'Conversations.Conversations.PerPage' , 50 ) ) ; $ this -> Offset = $ Offset ; $ UserID = $ this -> Request ->... | Show all conversations for the currently authenticated user . |
18,505 | public function Clear ( $ ConversationID = FALSE , $ TransientKey = '' ) { $ Session = Gdn :: Session ( ) ; $ this -> _DeliveryType = DELIVERY_TYPE_BOOL ; $ ValidID = ( is_numeric ( $ ConversationID ) && $ ConversationID > 0 ) ; $ ValidSession = ( $ Session -> UserID > 0 && $ Session -> ValidateTransientKey ( $ Transie... | Clear the message history for a specific conversation & user . |
18,506 | public function Bookmark ( $ ConversationID = '' , $ TransientKey = '' ) { $ Session = Gdn :: Session ( ) ; $ Success = FALSE ; $ Star = FALSE ; if ( is_numeric ( $ ConversationID ) && $ ConversationID > 0 && $ Session -> UserID > 0 && $ Session -> ValidateTransientKey ( $ TransientKey ) ) { $ Bookmark = $ this -> Conv... | Allows users to bookmark conversations . |
18,507 | protected function extractTypeHintFromComment ( $ comment ) { if ( empty ( $ comment ) ) { return [ null , null ] ; } if ( ! preg_match ( '(\(DC2Type:(\w+)\))' , $ comment , $ match ) ) { return [ null , $ comment ] ; } $ type = $ match [ 1 ] ; $ comment = trim ( str_replace ( '(DC2Type:' . $ type . ')' , '' , $ commen... | Split a type - hint for Database Access Layer from comment . |
18,508 | protected function compileColumnDefinition ( array $ options ) { $ options = array_merge ( [ 'type' => null , 'size' => null , 'scale' => null , 'nullable' => false , 'default' => null , 'collation' => null , 'comment' => null , ] , $ options ) ; $ type = strtolower ( $ options [ 'type' ] ) ; if ( $ type == 'identity' ... | Compile the column definitions . |
18,509 | protected function compileFieldType ( $ type , $ size , $ scale ) { switch ( strtolower ( $ type ) ) { case 'smallint' : return 'SMALLINT' ; case 'integer' : return 'INT' ; case 'unsigned' : return 'INT UNSIGNED' ; case 'bigint' : return 'BIGINT' ; case 'numeric' : return 'NUMERIC(' . ( $ size ? : 10 ) . ', ' . ( $ sca... | Compile the column type . |
18,510 | public function forceSwitch ( $ dbHost , $ dbName , $ dbUser , $ dbPassword , array $ dbOptions = array ( ) ) { if ( $ this -> getSession ( ) -> has ( self :: SESSION_CONNECTION_KEY ) ) { $ current = $ this -> getSession ( ) -> get ( self :: SESSION_CONNECTION_KEY ) ; if ( $ current [ self :: PARAM_HOST ] === $ dbHost ... | Force a switch of database connection . |
18,511 | protected function getParamsKey ( ) { return array ( self :: PARAM_DRIVER_OPTIONS , self :: PARAM_HOST , self :: PARAM_DATABASE , self :: PARAM_USER , self :: PARAM_PASSWORD , ) ; } | Get a list of parameter keys |
18,512 | protected function hasNewConnectionParams ( array $ params ) { if ( ! $ this -> getSession ( ) -> has ( self :: SESSION_CONNECTION_KEY ) ) { return true ; } $ currentParams = $ this -> getSession ( ) -> get ( self :: SESSION_CONNECTION_KEY ) ; foreach ( $ this -> getParamsKey ( ) as $ key ) { if ( isset ( $ currentPara... | Checks if has new connection parameters |
18,513 | public function remove ( $ key ) { $ value = $ this -> elements [ $ this -> hash ( $ key ) ] ; unset ( $ this -> elements [ $ this -> hash ( $ key ) ] ) ; $ this -> fire ( new MapRemoveEvent ( $ key , $ value ) ) ; return $ value ; } | Removes element with given key . |
18,514 | protected function & getIntlNumberFormatter ( $ langAndLocale = NULL , $ style = NULL , $ pattern = NULL , $ attributes = [ ] , $ textAttributes = [ ] ) { $ key = implode ( '_' , [ 'number' , serialize ( func_get_args ( ) ) ] ) ; if ( ! isset ( $ this -> intlFormatters [ $ key ] ) ) { $ formatter = \ numfmt_create ( $ ... | Get stored \ NumberFormatter instance or create new one . |
18,515 | protected function setUpLocaleConventions ( ) { $ this -> localeConventions = NULL ; if ( $ this -> systemEncoding !== NULL ) { $ this -> localeConventions = ( object ) localeconv ( ) ; } if ( ! $ this -> localeConventions || $ this -> localeConventions -> frac_digits == 127 ) $ this -> localeConventions = ( object ) $... | Try to set up local conventions by system locale settings only if there was any success with setting up system locale . If system locale is not set up properly - use default formatting conventions . |
18,516 | public function save ( $ object ) { if ( is_array ( $ object ) ) { $ objectData = $ object ; if ( $ object [ 'id' ] > 0 ) { $ object = $ this -> find ( $ object [ 'id' ] ) ; } else { $ object = new Navigation ( ) ; $ site = $ this -> siteManager -> find ( $ objectData [ 'site' ] ) ; $ object -> setSite ( $ site ) ; } i... | save a Navigation you can pass the Navigation object or an array with the fields if you pass an array the keys must be with underscore and not with CamelCase |
18,517 | public static function get ( $ name , $ var = [ ] , $ absolute = false ) { $ routes = self :: resolveStatic ( RESOLVE_ROUTE , $ name ) ; if ( isset ( $ routes [ 0 ] [ '' . $ routes [ 1 ] . '' ] ) ) { $ route = $ routes [ 0 ] [ '' . $ routes [ 1 ] . '' ] ; $ url = preg_replace ( '#\((.*)\)#isU' , '<($1)>' , $ route [ 'u... | get an url |
18,518 | public function countBanLogEntries ( ) : int { $ this -> db -> qb ( [ 'table' => 'core_bans' , 'fields' => 'COUNT(ip)' , 'filter' => 'ip=:ip AND logstamp+:ttl > :expires AND code>0' , 'params' => [ ':ip' => $ this -> ip , ':ttl' => $ this -> ttl_banlog_entry , ':expires' => time ( ) ] ] ) ; return $ this -> db -> value... | Returns the number of ban entires in the log for an IP address within the set duration . |
18,519 | public function getBanActiveTimestamp ( ) : int { $ this -> db -> qb ( [ 'table' => 'core_bans' , 'fields' => 'logstamp' , 'filter' => 'ip=:ip AND code=0' , 'params' => [ ':ip' => $ this -> ip ] , 'order' => 'logstamp DESC' , 'limit' => 1 ] ) ; $ data = $ this -> db -> value ( ) ; return $ data ? $ data : 0 ; } | Returns the timestamp from log when ban got active for this ip |
18,520 | public function render ( array $ data , ContextInterface $ context ) { $ data += [ 'value' => 1 , 'val' => null , 'disabled' => false , 'onLabel' => 'on' , 'offLabel' => 'off' , 'class' => '' ] ; if ( $ this -> _isChecked ( $ data ) ) { $ data [ 'checked' ] = true ; } unset ( $ data [ 'val' ] ) ; $ attrs = $ this -> _t... | Render a switchToggle element . |
18,521 | public static function create ( $ actual , $ expected , $ code = 0 , \ Exception $ prev = null ) { $ message = sprintf ( 'The value must be a type of %s, %s given.' , is_object ( $ expected ) ? get_class ( $ expected ) : ( is_scalar ( $ expected ) ? $ expected : gettype ( $ expected ) ) , is_object ( $ actual ) ? get_c... | Create a new exception |
18,522 | public function select ( $ tableName , $ tableAlias = null ) { return $ this -> dbFactory -> facade ( 'Select' , $ this -> pdo , $ tableName , $ tableAlias ) ; } | Get an prepare instance of a select facade for an easy access to the database . |
18,523 | public function mapErrorsToForm ( ConstraintViolationListInterface $ errors , FormInterface $ form ) { $ messages = $ this -> extractMessages ( $ errors ) ; $ this -> mapMessagesToElementCollection ( $ messages , $ form -> getChildren ( ) ) ; } | Maps errors messages to all form elements |
18,524 | protected function mapMessagesToElementCollection ( array $ messages , ElementCollection $ children ) { $ children -> forAll ( function ( ElementInterface $ element ) use ( $ messages ) { $ this -> mapMessagesToElement ( $ messages , $ element ) ; } ) ; } | Maps errors to elements children |
18,525 | protected function mapMessagesToElement ( array $ messages , ElementInterface $ element ) { if ( $ element -> hasPropertyPath ( ) ) { $ propertyPathParts = explode ( '.' , $ element -> getPropertyPath ( false ) ) ; $ propertyPath = $ this -> buildPath ( $ propertyPathParts ) ; if ( $ this -> propertyAccessor -> isReada... | Sets errors on element |
18,526 | public function getDocumentListFeed ( $ location = null ) { if ( $ location === null ) { $ uri = self :: DOCUMENTS_LIST_FEED_URI ; } else if ( $ location instanceof Zend_Gdata_Query ) { $ uri = $ location -> getQueryUrl ( ) ; } else { $ uri = $ location ; } return parent :: getFeed ( $ uri , 'Zend_Gdata_Docs_DocumentLi... | Retreive feed object containing entries for the user s documents . |
18,527 | public function getDocumentListEntry ( $ location = null ) { if ( $ location === null ) { require_once 'Zend/Gdata/App/InvalidArgumentException.php' ; throw new Zend_Gdata_App_InvalidArgumentException ( 'Location must not be null' ) ; } else if ( $ location instanceof Zend_Gdata_Query ) { $ uri = $ location -> getQuery... | Retreive entry object representing a single document . |
18,528 | public function uploadFile ( $ fileLocation , $ title = null , $ mimeType = null , $ uri = null ) { if ( $ uri === null ) { $ uri = $ this -> _defaultPostUri ; } $ fs = $ this -> newMediaFileSource ( $ fileLocation ) ; if ( $ title !== null ) { $ slugHeader = $ title ; } else { $ slugHeader = $ fileLocation ; } $ fs ->... | Upload a local file to create a new Google Document entry . |
18,529 | public function createFolder ( $ folderName , $ folderResourceId = null ) { $ category = new Zend_Gdata_App_Extension_Category ( self :: DOCUMENTS_CATEGORY_TERM , self :: DOCUMENTS_CATEGORY_SCHEMA ) ; $ title = new Zend_Gdata_App_Extension_Title ( $ folderName ) ; $ entry = new Zend_Gdata_Entry ( ) ; $ entry -> setCate... | Creates a new folder in Google Docs |
18,530 | public function encodeUrl ( ) { $ ignore = [ '%21' => '!' , '%23' => '#' , '%24' => '$' , '%26' => '&' , '%27' => '\'' , '%28' => '(' , '%29' => ')' , '%2A' => '*' , '%2B' => '+' , '%2C' => ',' , '%2D' => '-' , '%2E' => '.' , '%2F' => '/' , '%3A' => ':' , '%3B' => ';' , '%3D' => '=' , '%3F' => '?' , '%40' => '@' , '%5F... | Escape special characters for use in an URL . |
18,531 | public function handle ( $ pattern , $ resultHandler , $ partHandler ) { $ nodes = [ ] ; $ text = preg_replace_callback ( $ pattern , function ( $ matches ) use ( & $ nodes ) { $ nodes [ ] = $ matches ; return "\0" ; } , $ this -> text ) ; $ parts = explode ( "\0" , $ text ) ; $ match = 0 ; foreach ( $ nodes as $ node ... | Find the given regular expression and execute callbacks on it and its surroundings . |
18,532 | public function addArrayAsChildren ( array $ array , SimpleXMLElement $ xmlElement , $ ignoreEmptyElements = true ) { $ children = [ ] ; foreach ( $ array as $ key => $ value ) { if ( $ this -> isEmpty ( $ value ) && $ ignoreEmptyElements ) { continue ; } if ( $ key === '@attributes' ) { if ( ! is_array ( $ value ) ) {... | Convert an array into XML and adds the whole structure as a child of the existing SimpleXMLElement given . An array of inserted children is returned so you can add further children to them if necessary . |
18,533 | private function getBox ( array $ coordinates ) { $ height = abs ( $ coordinates [ 'y1' ] - $ coordinates [ 'y2' ] ) ; $ width = abs ( $ coordinates [ 'x1' ] - $ coordinates [ 'x2' ] ) ; return new Box ( $ width , $ height ) ; } | Get box . |
18,534 | public function listAction ( ) { $ user = $ this -> getUser ( ) ; $ repository = $ this -> get ( 'ekyna_user.address.repository' ) ; $ addresses = $ repository -> findByUser ( $ user ) ; return $ this -> render ( 'EkynaUserBundle:Address:list.html.twig' , [ 'addresses' => $ addresses ] ) ; } | List address action . |
18,535 | public function newAction ( Request $ request ) { $ user = $ this -> getUser ( ) ; $ repository = $ this -> get ( 'ekyna_user.address.repository' ) ; $ address = $ repository -> createNew ( ) ; $ address -> setUser ( $ user ) ; $ cancelPath = $ this -> generateUrl ( 'ekyna_user_address_list' ) ; $ form = $ this -> crea... | New address action . |
18,536 | public function editAction ( Request $ request ) { $ user = $ this -> getUser ( ) ; $ repository = $ this -> get ( 'ekyna_user.address.repository' ) ; if ( null === $ address = $ repository -> find ( $ request -> attributes -> get ( 'addressId' ) ) ) { throw new NotFoundHttpException ( 'Address not found.' ) ; } if ( $... | Edit address action . |
18,537 | public static function validate ( ) { $ instance = static :: get_instance ( ) ; $ error = new \ WP_Error ( ) ; foreach ( get_class_methods ( $ instance ) as $ method ) { $ repl = new \ ReflectionMethod ( get_called_class ( ) , $ method ) ; if ( ! $ repl -> isPublic ( ) ) { continue ; } if ( 0 !== strpos ( $ method , 't... | Validate all method |
18,538 | public function & vars ( ) { if ( empty ( $ _SESSION [ $ this -> getContext ( ) ] ) ) { $ _SESSION [ $ this -> getContext ( ) ] = [ ] ; } return $ _SESSION [ $ this -> getContext ( ) ] ; } | Returns the reference to the array of the session variables . |
18,539 | protected function addDataGridServiceDefinition ( $ code , array $ dataGridConfiguration , ContainerBuilder $ container ) { $ dataGridConfiguration = $ this -> finalizeConfiguration ( $ code , $ dataGridConfiguration , $ container ) ; $ definition = new Definition ( new Parameter ( 'sidus_eav_data_grid.model.datagrid.c... | Add a new Filter service based on the configuration passed inside the datagrid |
18,540 | protected function addFilterConfiguration ( $ code , array $ dataGridConfiguration , ContainerBuilder $ container ) { $ dataGridConfiguration [ 'filter_config' ] [ 'family' ] = $ dataGridConfiguration [ 'family' ] ; $ filterConfig = $ this -> finalizeFilterConfiguration ( $ code , $ dataGridConfiguration [ 'filter_conf... | Handle direct configuration of filters uses the same logic than the FilterBundle to generate a service |
18,541 | public function generateFullKey ( string $ key = '' ) : string { if ( ! $ this -> context || ! $ this -> identifier ) { throw new \ InvalidArgumentException ( 'You have to run setContext and setIdentifier methods first' ) ; } return implode ( '_' , [ static :: class , $ this -> context , $ this -> identifier , $ key , ... | all examples below are in context of storage keys |
18,542 | public function all ( $ object = true ) { $ properties = get_object_vars ( $ this ) ; if ( $ object ) { return ( object ) $ properties ; } return $ properties ; } | Returns an associative array of the object properties |
18,543 | private function validateWhereClause ( $ table , $ where ) { foreach ( $ where as $ column => $ value ) { if ( ! $ this -> isInputValid ( $ table , $ column , $ value ) ) { return false ; } } return true ; } | Validate WHERE binding for SQL statement |
18,544 | public function isValidInput ( $ table , $ column , $ value ) { $ table_object = $ this -> ContentContract -> tables [ $ table ] ; $ column_type_validator = $ table_object :: SCHEMA [ $ column ] ; return $ this -> ContentContract -> validators [ $ column_type_validator ] ( $ value ) ; } | Check value against given filter |
18,545 | public function isValidColumn ( $ table , $ column ) { $ table_object = ( $ this -> ContentContract -> tables [ $ table ] ) ; $ schema = $ table_object :: SCHEMA ; return isset ( $ schema [ $ column ] ) ; } | Checks a column exists in a given table |
18,546 | private function validateTableAndCol ( $ table , $ columns ) { if ( ! $ this -> isValidTable ( $ table ) ) { return false ; } foreach ( $ columns as $ column ) { if ( ! $ this -> isValidColumn ( $ table , $ column ) ) { return false ; } } return true ; } | Wrapper function to validate a table and columns |
18,547 | private function validateBind ( $ table , $ data ) { foreach ( $ data as $ column => $ value ) { if ( ! $ this -> isValidInput ( $ table , $ column , $ value ) ) { return false ; } } return true ; } | Validate a set of columns and values |
18,548 | public static function create ( $ key , $ code = 0 , \ Exception $ prev = null ) { $ message = sprintf ( 'Not found server with key "%s".' , $ key ) ; return new static ( $ message , $ code , $ prev ) ; } | Create new exception instance with key |
18,549 | public function source ( Size $ size ) : string { return $ this -> maker ( ) -> make ( $ this -> name , $ this -> options ( $ size ) ) ; } | Return the URL for the image resized to the given width . |
18,550 | public function sourceSet ( SizeRange $ range ) : string { return $ range -> toVector ( ) -> map ( function ( $ size ) { return $ this -> source ( $ size ) . " {$size}w" ; } ) -> join ( ', ' ) ; } | Return the contents of a srcset attribute for the given range of widths . |
18,551 | public function tag ( SizeRange $ range , Size $ defaultSize , array $ attributes = [ ] ) : string { $ attributes = new Map ( $ attributes ) ; $ attributes [ 'alt' ] = $ attributes [ 'alt' ] ?? '' ; $ attributes [ 'sizes' ] = $ attributes [ 'sizes' ] ?? '100vw' ; $ attributes [ 'src' ] = $ this -> source ( $ defaultSiz... | Return a responsive HTML img tag for the image . |
18,552 | public static function fromShape ( Shape $ shape , Name $ name , array $ options = [ ] , Maker $ maker = null ) : self { switch ( $ shape ) { case 'square' : return new Square ( $ name , $ options , $ maker ) ; case 'tall' : return new Tall ( $ name , $ options , $ maker ) ; case 'wide' : return new Wide ( $ name , $ o... | Return an Image object of the appropriate class based on a Shape value . |
18,553 | public function createDefaultOrganization ( ) { $ organization = new Organization ( ) ; $ organization -> setName ( $ this -> getUsername ( ) ) ; $ this -> organizations [ ] = $ organization ; } | Create default Organization |
18,554 | public function dates ( string $ strStartDate = null , $ mEndDate = null ) { return new SkeDateIterator ( static :: $ oModel , $ strStartDate , $ mEndDate ) ; } | Get dates iterator . |
18,555 | public static function skeDoosh ( array $ aOptions ) { echo <<<EOD<script> if (typeof jQuery == 'undefined') { skedLoadTag( 'http://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js', loadSkedJs ); } else { loadSkedJs(); } function skedLoadTag(strSrc, fnOn... | Do it all in one easy method call . |
18,556 | public function delete ( ) { $ return = false ; if ( isset ( $ this -> tokenId ) ) { $ return = $ this -> apiCall -> delete ( $ this -> endpoint . '/delete' , array ( 'tokenId' => $ this -> tokenId ) ) ; } return $ return ; } | Deletes a token . |
18,557 | private function addMetas ( $ type , array $ values ) { foreach ( $ values as $ key => $ value ) { $ this -> seoPage -> addMeta ( $ type , $ key , $ value ) ; } } | Add metas . |
18,558 | public function handleLoginRequest ( LoginRequest $ request ) { $ socialLogin = $ this -> socialLoginMapper -> findByProviderUserId ( $ request -> getProvider ( ) , $ request -> getProviderUserId ( ) ) ; if ( $ socialLogin ) { $ user = $ this -> userService -> findById ( $ socialLogin -> getUserId ( ) ) ; $ this -> upd... | Handle a request to log in via a social login provider |
18,559 | public function handleLinkRequest ( LoginRequest $ request , $ userId ) { $ socialLogin = $ this -> socialLoginMapper -> findByProviderUserId ( $ request -> getProvider ( ) , $ request -> getProviderUserId ( ) ) ; if ( $ socialLogin ) { throw new LinkedAccountExistsException ; } $ user = $ this -> userService -> findBy... | Handle a request to link a social account to a non - social account |
18,560 | public function registerFromSocialLogin ( LoginRequest $ request ) { $ email = $ request -> getEmails ( ) [ 0 ] ; $ user = $ this -> userService -> registerWithoutPassword ( array ( 'email' => $ email ) ) ; $ socialLoginEntity = new SocialLoginEntity ; $ socialLoginEntity -> setUserId ( $ user -> getId ( ) ) -> setProv... | Register a new user account from a social login provider |
18,561 | public function userHasSocialLoginWithProvider ( $ provider , $ user ) { return ( bool ) $ this -> socialLoginMapper -> findBy ( [ 'provider' => $ provider , 'user_id' => $ user -> getId ( ) ] ) ; } | Determine if a given user has a social login linked with a given provider |
18,562 | public function handleLogin ( UserEntity $ user ) { $ accessToken = new AccessToken ( $ this -> tokenStorage , $ this -> tokenStorage ) ; $ token = $ accessToken -> createAccessToken ( '' , $ user -> getId ( ) , null , true ) ; return $ token ; } | Create an access token given a user entity |
18,563 | protected function updateSocialLoginToken ( SocialLoginEntity $ socialLogin , LoginRequest $ request ) { $ socialLogin -> setAccessToken ( $ request -> getAccessToken ( ) ) -> setAccessTokenExpires ( $ request -> getAccessTokenExpires ( ) ) -> setRefreshToken ( $ request -> getRefreshToken ( ) ) ; $ this -> socialLogin... | Update a users OAuth token token expiration and refresh token information when they log in |
18,564 | public function getAncestor ( $ id ) { if ( ! is_null ( $ this -> parent ) ) { if ( $ this -> parent -> id ( ) == $ id ) { return $ this -> parent ; } return $ this -> parent -> getAncestor ( $ id ) ; } return null ; } | Attempts to get an ancestor node by the given id . |
18,565 | public function nextSibling ( ) { if ( is_null ( $ this -> parent ) ) { throw new ParentNotFoundException ( 'Parent is not set for this node.' ) ; } return $ this -> parent -> nextChild ( $ this -> id ) ; } | Attempts to get the next sibling . |
18,566 | public function previousSibling ( ) { if ( is_null ( $ this -> parent ) ) { throw new ParentNotFoundException ( 'Parent is not set for this node.' ) ; } return $ this -> parent -> previousChild ( $ this -> id ) ; } | Attempts to get the previous sibling |
18,567 | public function ancestorByTag ( $ tag ) { $ node = $ this ; while ( ! is_null ( $ node ) ) { if ( $ node -> tag -> name ( ) == $ tag ) { return $ node ; } $ node = $ node -> getParent ( ) ; } throw new ParentNotFoundException ( 'Could not find an ancestor with "' . $ tag . '" tag' ) ; } | Function to locate a specific ancestor tag in the path to the root . |
18,568 | public function getByName ( string $ role ) : ? IRole { if ( null === $ this -> roles ) { $ this -> getAll ( ) ; } if ( ! isset ( $ this -> names [ $ role ] ) ) { return null ; } return $ this -> roles [ $ this -> names [ $ role ] ] ; } | Get a role by its name |
18,569 | public function getMultipleByName ( array $ roles ) : iterable { if ( null === $ this -> roles ) { $ this -> getAll ( ) ; } $ results = [ ] ; foreach ( $ roles as $ role ) { if ( isset ( $ this -> names [ $ role ] ) ) { $ results [ ] = $ this -> roles [ $ this -> names [ $ role ] ] ; } } return $ results ; } | Get roles by their names |
18,570 | public function addVisitor ( \ BlackForest \ PiwikBundle \ Entity \ PiwikVisitor $ visitor ) { $ this -> visitor [ ] = $ visitor ; return $ this ; } | Add visitor . |
18,571 | public function removeVisitor ( \ BlackForest \ PiwikBundle \ Entity \ PiwikVisitor $ visitor ) { return $ this -> visitor -> removeElement ( $ visitor ) ; } | Remove visitor . |
18,572 | public function addVisitorType ( \ BlackForest \ PiwikBundle \ Entity \ PiwikVisitorType $ visitorType ) { $ this -> visitorType [ ] = $ visitorType ; return $ this ; } | Add visitorType . |
18,573 | public function removeVisitorType ( \ BlackForest \ PiwikBundle \ Entity \ PiwikVisitorType $ visitorType ) { return $ this -> visitorType -> removeElement ( $ visitorType ) ; } | Remove visitorType . |
18,574 | public function addReferrerType ( \ BlackForest \ PiwikBundle \ Entity \ PiwikReferrerType $ referrerType ) { $ this -> referrerType [ ] = $ referrerType ; return $ this ; } | Add referrerType . |
18,575 | public function removeReferrerType ( \ BlackForest \ PiwikBundle \ Entity \ PiwikReferrerType $ referrerType ) { return $ this -> referrerType -> removeElement ( $ referrerType ) ; } | Remove referrerType . |
18,576 | public function addSearchEngine ( \ BlackForest \ PiwikBundle \ Entity \ PiwikSearchEngine $ searchEngine ) { $ this -> searchEngine [ ] = $ searchEngine ; return $ this ; } | Add searchEngine . |
18,577 | public function removeSearchEngine ( \ BlackForest \ PiwikBundle \ Entity \ PiwikSearchEngine $ searchEngine ) { return $ this -> searchEngine -> removeElement ( $ searchEngine ) ; } | Remove searchEngine . |
18,578 | public function addLanguage ( \ BlackForest \ PiwikBundle \ Entity \ PiwikLanguage $ language ) { $ this -> language [ ] = $ language ; return $ this ; } | Add language . |
18,579 | public function removeLanguage ( \ BlackForest \ PiwikBundle \ Entity \ PiwikLanguage $ language ) { return $ this -> language -> removeElement ( $ language ) ; } | Remove language . |
18,580 | public function addDevice ( \ BlackForest \ PiwikBundle \ Entity \ PiwikDevice $ device ) { $ this -> device [ ] = $ device ; return $ this ; } | Add device . |
18,581 | public function removeDevice ( \ BlackForest \ PiwikBundle \ Entity \ PiwikDevice $ device ) { return $ this -> device -> removeElement ( $ device ) ; } | Remove device . |
18,582 | public function addOperatingSystem ( \ BlackForest \ PiwikBundle \ Entity \ PiwikOperatingSystem $ operatingSystem ) { $ this -> operatingSystem [ ] = $ operatingSystem ; return $ this ; } | Add operatingSystem . |
18,583 | public function removeOperatingSystem ( \ BlackForest \ PiwikBundle \ Entity \ PiwikOperatingSystem $ operatingSystem ) { return $ this -> operatingSystem -> removeElement ( $ operatingSystem ) ; } | Remove operatingSystem . |
18,584 | public function addBrowser ( \ BlackForest \ PiwikBundle \ Entity \ PiwikBrowser $ browser ) { $ this -> browser [ ] = $ browser ; return $ this ; } | Add browser . |
18,585 | public function removeBrowser ( \ BlackForest \ PiwikBundle \ Entity \ PiwikBrowser $ browser ) { return $ this -> browser -> removeElement ( $ browser ) ; } | Remove browser . |
18,586 | public function addCountry ( \ BlackForest \ PiwikBundle \ Entity \ PiwikCountry $ country ) { $ this -> country [ ] = $ country ; return $ this ; } | Add country . |
18,587 | public function removeCountry ( \ BlackForest \ PiwikBundle \ Entity \ PiwikCountry $ country ) { return $ this -> country -> removeElement ( $ country ) ; } | Remove country . |
18,588 | public function addResolution ( \ BlackForest \ PiwikBundle \ Entity \ PiwikResolution $ resolution ) { $ this -> resolution [ ] = $ resolution ; return $ this ; } | Add resolution . |
18,589 | public function removeResolution ( \ BlackForest \ PiwikBundle \ Entity \ PiwikResolution $ resolution ) { return $ this -> resolution -> removeElement ( $ resolution ) ; } | Remove resolution . |
18,590 | public function addEcomerceStatus ( \ BlackForest \ PiwikBundle \ Entity \ PiwikEcomerceStatus $ ecomerceStatus ) { $ this -> ecomerceStatus [ ] = $ ecomerceStatus ; return $ this ; } | Add ecomerceStatus . |
18,591 | public function removeEcomerceStatus ( \ BlackForest \ PiwikBundle \ Entity \ PiwikEcomerceStatus $ ecomerceStatus ) { return $ this -> ecomerceStatus -> removeElement ( $ ecomerceStatus ) ; } | Remove ecomerceStatus . |
18,592 | public function addVisitPlugin ( \ BlackForest \ PiwikBundle \ Entity \ PiwikVisitPlugin $ visitPlugin ) { $ this -> visitPlugin [ ] = $ visitPlugin ; return $ this ; } | Add visitPlugin . |
18,593 | public function removeVisitPlugin ( \ BlackForest \ PiwikBundle \ Entity \ PiwikVisitPlugin $ visitPlugin ) { return $ this -> visitPlugin -> removeElement ( $ visitPlugin ) ; } | Remove visitPlugin . |
18,594 | public function addCurrency ( \ BlackForest \ PiwikBundle \ Entity \ PiwikCurrency $ currency ) { $ this -> currencies [ ] = $ currency ; return $ this ; } | Add currency . |
18,595 | public function removeCurrency ( \ BlackForest \ PiwikBundle \ Entity \ PiwikCurrency $ currency ) { return $ this -> currencies -> removeElement ( $ currency ) ; } | Remove currency . |
18,596 | public function removeAction ( \ BlackForest \ PiwikBundle \ Entity \ PiwikAction $ action ) { return $ this -> action -> removeElement ( $ action ) ; } | Remove action . |
18,597 | public function addActionType ( \ BlackForest \ PiwikBundle \ Entity \ PiwikActionType $ actionType ) { $ this -> actionType [ ] = $ actionType ; return $ this ; } | Add actionType . |
18,598 | public function removeActionType ( \ BlackForest \ PiwikBundle \ Entity \ PiwikActionType $ actionType ) { return $ this -> actionType -> removeElement ( $ actionType ) ; } | Remove actionType . |
18,599 | public function addPlugin ( \ BlackForest \ PiwikBundle \ Entity \ PiwikPlugin $ plugin ) { $ this -> plugin [ ] = $ plugin ; return $ this ; } | Add plugin . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.