idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
12,600
public static function oxford ( array $ items , $ conjunction = 'and' ) { $ count = count ( $ items ) ; if ( $ count < 2 ) { return ( string ) reset ( $ items ) ; } elseif ( $ count === 2 ) { return reset ( $ items ) . ' ' . $ conjunction . ' ' . end ( $ items ) ; } else { $ items [ ] = $ conjunction . ' ' . array_pop ...
Formats a set of strings with an Oxford comma .
12,601
public static function entityClass ( EntityTypeInterface $ entity_type , $ replacement_class ) { if ( get_parent_class ( $ replacement_class ) == $ entity_type -> getClass ( ) ) { $ entity_type -> setClass ( $ replacement_class ) ; } }
Overrides the entity class for an entity type .
12,602
public static function entityForm ( EntityTypeInterface $ entity_type , $ replacement_class , $ operation = 'default' ) { if ( get_parent_class ( $ replacement_class ) == $ entity_type -> getFormClass ( $ operation ) ) { $ entity_type -> setFormClass ( $ operation , $ replacement_class ) ; } }
Overrides the class used for an entity form .
12,603
public static function entityHandler ( EntityTypeInterface $ entity_type , $ handler_type , $ replacement_class ) { if ( get_parent_class ( $ replacement_class ) == $ entity_type -> getHandlerClass ( $ handler_type ) ) { $ entity_type -> setHandlerClass ( $ handler_type , $ replacement_class ) ; } }
Overrides the class used for an entity handler .
12,604
public function processUploadElement ( array $ element , FormStateInterface $ form_state ) { $ element = AjaxUpload :: process ( $ element , $ form_state ) ; $ element [ 'upload' ] [ '#ajax' ] [ 'callback' ] = $ element [ 'remove' ] [ '#ajax' ] [ 'callback' ] = [ static :: class , 'ajax' ] ; $ element [ 'remove' ] [ '#...
Processes the upload element .
12,605
public function loadEntitiesByProperties ( $ entity_type , array $ values ) { $ entities = $ this -> entityTypeManager -> getStorage ( $ entity_type ) -> loadByProperties ( $ values ) ; if ( ! empty ( $ entities ) ) { return $ entities ; } }
Load entity by property .
12,606
public function mapBasicField ( array & $ values , $ field_name ) { $ item = $ this -> item ; if ( ! empty ( $ item [ $ field_name ] ) ) { $ values [ $ field_name ] = $ item [ $ field_name ] ; } }
Maps a base field .
12,607
public function mapParagraphField ( array $ paragraphs ) { $ entities = \ Drupal :: classResolver ( ) -> getInstanceFromDefinition ( InstallHelper :: class ) -> importParagraphs ( $ paragraphs ) ; if ( ! empty ( $ entities ) ) { return $ entities ; } return [ ] ; }
Maps a paragraph field .
12,608
public function populateMediaField ( $ field_name ) { $ item = $ this -> item ; $ assets = [ ] ; if ( ! empty ( $ item [ $ field_name ] ) ) { $ data = $ this -> loadDataArray ( 'media_image' ) ; foreach ( $ item [ $ field_name ] as $ k => $ value ) { if ( ! empty ( $ data [ $ value ] ) ) { $ name = $ data [ $ value ] [...
Finds a media asset by name .
12,609
public function mapTaxonomyTermField ( $ field_name , $ vid ) { $ entities = $ this -> populateTaxonomyTermField ( $ field_name , $ vid ) ; if ( ! empty ( $ entities ) ) { return $ entities ; } return [ ] ; }
Maps a taxonomy field .
12,610
public function populateTaxonomyTermField ( $ field_name , $ vid ) { $ item = $ this -> item ; $ terms = [ ] ; if ( ! empty ( $ item [ $ field_name ] ) ) { $ data = $ this -> loadDataArray ( 'taxonomy' ) ; foreach ( $ item [ $ field_name ] as $ k => $ value ) { if ( ! empty ( $ data [ $ value ] ) ) { $ name = $ data [ ...
Finds taxonomy terms by name and vid .
12,611
public function populateEntityReferenceField ( $ field_name ) { $ item = $ this -> item ; $ node = [ ] ; if ( ! empty ( $ item [ $ field_name ] ) ) { $ data = $ this -> loadDataArray ( 'node' ) ; foreach ( $ item [ $ field_name ] as $ k => $ value ) { if ( ! empty ( $ data [ $ value ] ) ) { $ title = $ data [ $ value ]...
Finds nodes by machine name .
12,612
protected function importPages ( ) { $ data = $ this -> loadDataArray ( 'node' ) ; if ( ! empty ( $ data ) ) { $ uuids = [ ] ; foreach ( $ data as $ item ) { $ values = [ 'type' => $ item [ 'type' ] , 'title' => $ item [ 'title' ] , ] ; if ( ! empty ( $ item [ 'body' ] ) ) { $ body = $ this -> getBodyData ( $ item [ 'b...
Imports pages .
12,613
protected function importMediaImages ( ) { $ data = $ this -> loadDataArray ( 'media_image' ) ; if ( ! empty ( $ data ) ) { $ uuids = [ ] ; foreach ( $ data as $ item ) { $ values = [ 'bundle' => $ item [ 'bundle' ] , 'name' => $ item [ 'name' ] , ] ; $ file = $ this -> saveFile ( $ item [ 'file' ] ) ; if ( ! empty ( $...
Import media assets .
12,614
protected function importTaxonomyTerms ( ) { $ data = $ this -> loadDataArray ( 'taxonomy' ) ; if ( ! empty ( $ data ) ) { $ uuids = [ ] ; foreach ( $ data as $ item ) { $ values = [ 'vid' => $ item [ 'vid' ] , 'name' => $ item [ 'name' ] , ] ; $ values [ 'uid' ] = 1 ; $ entity = $ this -> entityTypeManager -> getStora...
Import taxonomy terms .
12,615
public function importParagraphs ( array $ paragraphs ) { $ data = $ this -> loadDataArray ( 'paragraph' ) ; $ paragraph_items = [ ] ; $ uuids = [ ] ; foreach ( $ paragraphs as $ k => $ paragraph_data ) { $ item = $ data [ $ paragraph_data ] ; if ( ! empty ( $ item ) ) { $ values = [ 'type' => $ item [ 'type' ] , ] ; i...
Import paragraphs .
12,616
public function getBodyData ( $ body ) { $ module_path = $ this -> moduleHandler -> getModule ( 'govcms8_default_content' ) -> getPath ( ) ; if ( ! empty ( $ body ) ) { if ( is_array ( $ body ) && ! empty ( $ body [ 'file' ] ) ) { $ file = $ body [ 'file' ] ; $ body_path = $ module_path . '/import/html_body/' . $ file ...
Retrieves the body data from the array value or an HTML file .
12,617
public function loadProcessorPlugins ( & $ values , $ item , $ entity_type ) { $ manager = \ Drupal :: service ( 'plugin.manager.import_processor' ) ; $ import_processors = $ manager -> getDefinitions ( ) ; foreach ( $ import_processors as $ plugin_id => $ import_processor ) { if ( $ import_processor [ 'type' ] == $ en...
Helper method used to load the correct plugin .
12,618
public function saveFile ( $ file_name ) { $ path = 'public://govcms8-demo' ; if ( file_prepare_directory ( $ path , FILE_CREATE_DIRECTORY ) ) { $ source = DRUPAL_ROOT . '/' . drupal_get_path ( 'module' , 'govcms8_default_content' ) . '/import/images/' . $ file_name ; $ data = file_get_contents ( $ source ) ; return fi...
Save a file during the media import .
12,619
public function deleteImportedContent ( ) { $ uuids = $ this -> state -> get ( 'govcms8_default_content_uuids' , [ ] ) ; $ by_entity_type = array_reduce ( array_keys ( $ uuids ) , function ( $ carry , $ uuid ) use ( $ uuids ) { $ entity_type_id = $ uuids [ $ uuid ] ; $ carry [ $ entity_type_id ] [ ] = $ uuid ; return $...
Deletes any content imported by this module .
12,620
protected function getUser ( $ name ) { $ user_storage = $ this -> entityTypeManager -> getStorage ( 'user' ) ; $ users = $ user_storage -> loadByProperties ( [ 'name' => $ name ] ) ; ; if ( empty ( $ users ) ) { $ user = $ user_storage -> create ( [ 'name' => $ name , 'status' => 1 , ] ) ; $ user -> enforceIsNew ( ) ;...
Looks up a user by name if it is missing the user is created .
12,621
protected function getTerm ( $ term_name , $ vocabulary_id = 'tags' ) { $ term_name = trim ( $ term_name ) ; $ term_storage = $ this -> entityTypeManager -> getStorage ( 'taxonomy_term' ) ; $ terms = $ term_storage -> loadByProperties ( [ 'name' => $ term_name , 'vid' => $ vocabulary_id , ] ) ; if ( ! $ terms ) { $ ter...
Looks up a term by name if it is missing the term is created .
12,622
protected function createFileEntity ( $ path ) { $ uri = $ this -> fileUnmanagedCopy ( $ path ) ; $ file = $ this -> entityTypeManager -> getStorage ( 'file' ) -> create ( [ 'uri' => $ uri , 'status' => 1 , ] ) ; $ file -> save ( ) ; $ this -> storeCreatedContentUuids ( [ $ file -> uuid ( ) => 'file' ] ) ; return $ fil...
Creates a file entity based on an image path .
12,623
protected function storeCreatedContentUuids ( array $ uuids ) { $ uuids = $ this -> state -> get ( 'govcms8_default_content_uuids' , [ ] ) + $ uuids ; $ this -> state -> set ( 'govcms8_default_content_uuids' , $ uuids ) ; }
Stores record of content entities created by this import .
12,624
private function toDms ( float $ decimal , string $ axis = self :: LATITUDE ) : string { $ d = ( int ) floor ( abs ( $ decimal ) ) ; $ m = ( int ) floor ( ( abs ( $ decimal ) - $ d ) * 60 ) ; $ s = ( ( abs ( $ decimal ) - $ d ) * 60 - $ m ) * 60 ; if ( self :: LATITUDE === $ axis ) { $ h = ( $ decimal < 0 ) ? 'S' : 'N'...
Determine the degree minute seconds value from decimal .
12,625
private static function fullyQualify ( string $ subdomain , string $ parent ) : string { if ( '@' === $ subdomain ) { return $ parent ; } if ( '.' !== substr ( $ subdomain , - 1 , 1 ) ) { return $ subdomain . '.' . $ parent ; } return $ subdomain ; }
Add the parent domain to the sub - domain if the sub - domain if it is not fully qualified .
12,626
private function processResourceName ( \ ArrayIterator $ iterator , ResourceRecord $ resourceRecord ) : void { if ( $ this -> isResourceName ( $ iterator ) ) { $ this -> previousName = $ iterator -> current ( ) ; $ iterator -> next ( ) ; } $ resourceRecord -> setName ( $ this -> previousName ) ; }
Processes a ResourceRecord name .
12,627
private function processTtl ( \ ArrayIterator $ iterator , ResourceRecord $ resourceRecord ) : void { if ( $ this -> isTTL ( $ iterator ) ) { $ resourceRecord -> setTtl ( $ iterator -> current ( ) ) ; $ iterator -> next ( ) ; } }
Set RR s TTL if there is one .
12,628
private function processClass ( \ ArrayIterator $ iterator , ResourceRecord $ resourceRecord ) : void { if ( Classes :: isValid ( strtoupper ( $ iterator -> current ( ) ) ) ) { $ resourceRecord -> setClass ( strtoupper ( $ iterator -> current ( ) ) ) ; $ iterator -> next ( ) ; } }
Set RR s class if there is one .
12,629
private function isResourceName ( \ ArrayIterator $ iterator ) : bool { return ! ( $ this -> isTTL ( $ iterator ) || Classes :: isValid ( strtoupper ( $ iterator -> current ( ) ) ) || RDataTypes :: isValid ( strtoupper ( $ iterator -> current ( ) ) ) ) ; }
Determine if iterant is a resource name .
12,630
public static function newRdataFromName ( string $ name ) : RdataInterface { if ( ! self :: isTypeImplemented ( $ name ) ) { throw new UnsupportedTypeException ( $ name ) ; } $ namespace = '\\Badcow\\DNS\\Rdata\\' ; $ className = $ namespace . strtoupper ( $ name ) ; if ( ! class_exists ( $ className ) ) { $ className ...
Creates a new RData object from a name .
12,631
private function handleComment ( ) : void { if ( $ this -> string -> isNot ( Tokens :: SEMICOLON ) ) { return ; } while ( $ this -> string -> isNot ( Tokens :: LINE_FEED ) && $ this -> string -> valid ( ) ) { $ this -> string -> next ( ) ; } }
Ignores the comment section .
12,632
private function handleTxt ( ) : void { if ( $ this -> string -> isNot ( Tokens :: DOUBLE_QUOTES ) ) { return ; } $ this -> append ( ) ; while ( $ this -> string -> isNot ( Tokens :: DOUBLE_QUOTES ) ) { if ( ! $ this -> string -> valid ( ) ) { throw new ParseException ( 'Unbalanced double quotation marks. End of file r...
Handle text inside of double quotations . When this function is called the String pointer MUST be at the double quotation mark .
12,633
private function handleMultiline ( ) : void { if ( $ this -> string -> isNot ( Tokens :: OPEN_BRACKET ) ) { return ; } $ this -> string -> next ( ) ; while ( $ this -> string -> valid ( ) ) { $ this -> handleTxt ( ) ; $ this -> handleComment ( ) ; if ( $ this -> string -> is ( Tokens :: LINE_FEED ) ) { $ this -> string...
Move multi - line records onto single line .
12,634
private function removeWhitespace ( ) : void { $ string = preg_replace ( '/ {2,}/' , Tokens :: SPACE , $ this -> normalisedString ) ; $ lines = [ ] ; foreach ( explode ( Tokens :: LINE_FEED , $ string ) as $ line ) { if ( '' !== $ line = trim ( $ line ) ) { $ lines [ ] = $ line ; } } $ this -> normalisedString = implod...
Remove superfluous whitespace characters from string .
12,635
public static function fullyQualifiedDomainName ( string $ name ) : bool { $ isValid = strlen ( $ name ) < 254 ; $ isValid &= 1 === preg_match ( '/^(?:(?!-)[a-z0-9\-]{1,63}(?<!-)\.){1,127}$/i' , $ name ) ; return $ isValid ; }
Validate the string is a Fully Qualified Domain Name .
12,636
private static function countClasses ( Zone $ zone ) : int { $ classes = [ ] ; foreach ( $ zone as $ rr ) { if ( null !== $ rr -> getClass ( ) ) { $ classes [ $ rr -> getClass ( ) ] = null ; } } return count ( $ classes ) ; }
Determine the number of unique non - null classes in a Zone . In a valid zone this MUST be 1 .
12,637
private static function makeLine ( string $ text , ? string $ comment , int $ longestVarLength , int $ padding ) : string { $ output = str_repeat ( ' ' , $ padding ) . str_pad ( $ text , $ longestVarLength ) ; if ( null !== $ comment ) { $ output .= ' ' . self :: COMMENT_DELIMINATOR . $ comment ; } return $ output . PH...
Returns a padded line with comment .
12,638
private static function getPadding ( Zone $ zone ) { $ name = $ ttl = $ type = 0 ; foreach ( $ zone as $ resourceRecord ) { $ name = max ( $ name , strlen ( $ resourceRecord -> getName ( ) ) ) ; $ ttl = max ( $ ttl , strlen ( $ resourceRecord -> getTtl ( ) ) ) ; $ type = max ( $ type , strlen ( $ resourceRecord -> getT...
Get the padding required for a zone .
12,639
public function getClass ( ) : string { foreach ( $ this -> resourceRecords as $ resourceRecord ) { if ( null !== $ resourceRecord -> getClass ( ) ) { return $ resourceRecord -> getClass ( ) ; } } return Classes :: INTERNET ; }
Return the class of the zone defaults to IN .
12,640
public static function getMnemonic ( int $ algorithmId ) { if ( ! array_key_exists ( $ algorithmId , self :: $ mnemonic ) ) { throw new \ InvalidArgumentException ( sprintf ( '"%d" id not a valid algorithm.' , $ algorithmId ) ) ; } return self :: $ mnemonic [ $ algorithmId ] ; }
Get the associated mnemonic of an algorithm .
12,641
public static function expandIpv6 ( string $ ip ) : string { if ( ! Validator :: ipv6 ( $ ip ) ) { throw new \ InvalidArgumentException ( sprintf ( '"%s" is not a valid IPv6 address.' , $ ip ) ) ; } $ hex = unpack ( 'H*hex' , inet_pton ( $ ip ) ) ; return implode ( ':' , str_split ( $ hex [ 'hex' ] , 4 ) ) ; }
Expands an IPv6 address to its full non - shorthand representation .
12,642
public static function contractIpv6 ( string $ ip ) : string { if ( ! Validator :: ipv6 ( $ ip ) ) { throw new \ InvalidArgumentException ( sprintf ( '"%s" is not a valid IPv6 address.' , $ ip ) ) ; } return inet_ntop ( inet_pton ( $ ip ) ) ; }
Takes a valid IPv6 address and contracts it to its shorter version .
12,643
public static function reverseIpv4 ( string $ ip ) : string { $ octets = array_reverse ( explode ( '.' , $ ip ) ) ; return implode ( '.' , $ octets ) . '.in-addr.arpa.' ; }
Creates a reverse IPv4 address .
12,644
public static function reverseIpv6 ( string $ ip , bool $ appendSuffix = true ) : string { try { $ ip = self :: expandIpv6 ( $ ip ) ; } catch ( \ InvalidArgumentException $ e ) { $ ip = self :: expandIncompleteIpv6 ( $ ip ) ; } $ ip = str_replace ( ':' , '' , $ ip ) ; $ ip = strrev ( $ ip ) ; $ ip = implode ( '.' , str...
Creates a reverse IPv6 address .
12,645
private function getLineNumber ( ) : int { $ pos = $ this -> stringIterator -> key ( ) ; $ this -> stringIterator -> rewind ( ) ; $ lineNo = 1 ; while ( $ this -> stringIterator -> key ( ) < $ pos ) { if ( $ this -> stringIterator -> is ( Tokens :: LINE_FEED ) ) { ++ $ lineNo ; } $ this -> stringIterator -> next ( ) ; ...
Get line number of current entry on the StringIterator .
12,646
public static function dmsToDecimal ( int $ deg , int $ min , float $ sec , string $ hemisphere ) : float { $ multiplier = ( 'S' === $ hemisphere || 'W' === $ hemisphere ) ? - 1 : 1 ; return $ multiplier * ( $ deg + ( $ min / 60 ) + ( $ sec / 3600 ) ) ; }
Transform a DMS string to a decimal representation . Used for LOC records .
12,647
public static function catchAll ( string $ type , \ ArrayIterator $ iterator ) : Rdata \ RdataInterface { if ( ! Rdata \ Factory :: isTypeImplemented ( $ type ) ) { return new Rdata \ PolymorphicRdata ( $ type , implode ( Tokens :: SPACE , self :: getAllRemaining ( $ iterator ) ) ) ; } return call_user_func_array ( [ R...
Returns RData instances for types that do not have explicitly declared handler methods .
12,648
private static function pop ( \ ArrayIterator $ iterator ) : string { $ current = $ iterator -> current ( ) ; $ iterator -> next ( ) ; return $ current ; }
Return current entry and moves the iterator to the next entry .
12,649
private static function getAllRemaining ( \ ArrayIterator $ iterator ) : array { $ values = [ ] ; while ( $ iterator -> valid ( ) ) { $ values [ ] = $ iterator -> current ( ) ; $ iterator -> next ( ) ; } return $ values ; }
Get all the remaining values of an iterator as an array .
12,650
public function allowClientIncoming ( $ clientName ) { if ( preg_match ( '/\W/' , $ clientName ) ) { throw new \ InvalidArgumentException ( 'Only alphanumeric characters allowed in client name.' ) ; } if ( strlen ( $ clientName ) == 0 ) { throw new \ InvalidArgumentException ( 'Client name must not be a zero length str...
If the user of this token should be allowed to accept incoming connections then configure the TwilioCapability through this method and specify the client name .
12,651
public function generateToken ( $ ttl = 3600 ) { $ payload = array_merge ( $ this -> customClaims , array ( 'scope' => array ( ) , 'iss' => $ this -> accountSid , 'exp' => time ( ) + $ ttl , ) ) ; $ scopeStrings = array ( ) ; foreach ( $ this -> scopes as $ scope ) { if ( $ scope -> privilege == "outgoing" && $ this ->...
Generates a new token based on the credentials and permissions that previously has been granted to this token .
12,652
public static function compare ( $ a , $ b ) { $ result = true ; if ( strlen ( $ a ) != strlen ( $ b ) ) { return false ; } if ( ! $ a && ! $ b ) { return true ; } $ limit = strlen ( $ a ) ; for ( $ i = 0 ; $ i < $ limit ; ++ $ i ) { if ( $ a [ $ i ] != $ b [ $ i ] ) { $ result = false ; } } return $ result ; }
Time insensitive compare function s runtime is governed by the length of the first argument not the difference between the arguments .
12,653
public function create ( $ messagingServiceSid , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'MessagingServiceSid' => $ messagingServiceSid , 'FriendlyName' => $ options [ 'friendlyName' ] , 'Attributes' => $ options [ 'attributes' ] , 'DateCreated' => Serialize :: i...
Create a new SessionInstance
12,654
public function create ( $ identity , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'Identity' => $ identity , 'RoleSid' => $ options [ 'roleSid' ] , ) ) ; $ payload = $ this -> version -> create ( 'POST' , $ this -> uri , array ( ) , $ data ) ; return new InviteInstan...
Create a new InviteInstance
12,655
public function stream ( $ options = array ( ) , $ limit = null , $ pageSize = null ) { $ limits = $ this -> version -> readLimits ( $ limit , $ pageSize ) ; $ page = $ this -> page ( $ options , $ limits [ 'pageSize' ] ) ; return $ this -> version -> stream ( $ page , $ limits [ 'limit' ] , $ limits [ 'pageLimit' ] ) ...
Streams InviteInstance records from the API as a generator stream . This operation lazily loads records as efficiently as possible until the limit is reached . The results are returned as a generator so this operation is memory efficient .
12,656
public function getContext ( $ sid ) { return new InviteContext ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'channelSid' ] , $ sid ) ; }
Constructs a InviteContext
12,657
public function create ( $ availableAddOnSid , $ acceptTermsOfService , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'AvailableAddOnSid' => $ availableAddOnSid , 'AcceptTermsOfService' => Serialize :: booleanToString ( $ acceptTermsOfService ) , 'Configuration' => Ser...
Create a new InstalledAddOnInstance
12,658
public function create ( $ to , $ from , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'To' => $ to , 'From' => $ from , 'Parameters' => Serialize :: jsonObject ( $ options [ 'parameters' ] ) , ) ) ; $ payload = $ this -> version -> create ( 'POST' , $ this -> uri , ar...
Create a new EngagementInstance
12,659
public function create ( $ credentials , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'Credentials' => $ credentials , 'FriendlyName' => $ options [ 'friendlyName' ] , 'AccountSid' => $ options [ 'accountSid' ] , ) ) ; $ payload = $ this -> version -> create ( 'POST' ...
Create a new AwsInstance
12,660
public function getContext ( $ sid ) { return new ReservationContext ( $ this -> version , $ this -> solution [ 'workspaceSid' ] , $ this -> solution [ 'taskSid' ] , $ sid ) ; }
Constructs a ReservationContext
12,661
protected function getSessions ( ) { if ( ! $ this -> _sessions ) { $ this -> _sessions = new SessionList ( $ this -> version , $ this -> solution [ 'sid' ] ) ; } return $ this -> _sessions ; }
Access the sessions
12,662
protected function getPhoneNumbers ( ) { if ( ! $ this -> _phoneNumbers ) { $ this -> _phoneNumbers = new PhoneNumberList ( $ this -> version , $ this -> solution [ 'sid' ] ) ; } return $ this -> _phoneNumbers ; }
Access the phoneNumbers
12,663
protected function getShortCodes ( ) { if ( ! $ this -> _shortCodes ) { $ this -> _shortCodes = new ShortCodeList ( $ this -> version , $ this -> solution [ 'sid' ] ) ; } return $ this -> _shortCodes ; }
Access the shortCodes
12,664
protected function getAssignedAddOns ( ) { if ( ! $ this -> _assignedAddOns ) { $ this -> _assignedAddOns = new AssignedAddOnList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _assignedAddOns ; }
Access the assignedAddOns
12,665
protected function getFactors ( ) { if ( ! $ this -> _factors ) { $ this -> _factors = new FactorList ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'identity' ] ) ; } return $ this -> _factors ; }
Access the factors
12,666
public function request ( $ method , $ uri , $ params = array ( ) , $ data = array ( ) , $ headers = array ( ) , $ username = null , $ password = null , $ timeout = null ) { $ username = $ username ? $ username : $ this -> username ; $ password = $ password ? $ password : $ this -> password ; $ headers [ 'User-Agent' ]...
Makes a request to the Twilio API using the configured http client Authentication information is automatically added if none is provided
12,667
public function validateSslCertificate ( $ client ) { $ response = $ client -> request ( 'GET' , 'https://api.twilio.com:8443' ) ; if ( $ response -> getStatusCode ( ) < 200 || $ response -> getStatusCode ( ) > 300 ) { throw new TwilioException ( "Failed to validate SSL certificate" ) ; } }
Validates connection to new SSL certificate endpoint
12,668
protected function getAddOnResults ( ) { if ( ! $ this -> _addOnResults ) { $ this -> _addOnResults = new AddOnResultList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _addOnResults ; }
Access the addOnResults
12,669
protected function getFieldValues ( ) { if ( ! $ this -> _fieldValues ) { $ this -> _fieldValues = new FieldValueList ( $ this -> version , $ this -> solution [ 'assistantSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _fieldValues ; }
Access the fieldValues
12,670
public function create ( $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'FriendlyName' => $ options [ 'friendlyName' ] , ) ) ; $ payload = $ this -> version -> create ( 'POST' , $ this -> uri , array ( ) , $ data ) ; return new FleetInstance ( $ this -> version , $ payl...
Create a new FleetInstance
12,671
protected function getHighriskSpecialPrefixes ( ) { if ( ! $ this -> _highriskSpecialPrefixes ) { $ this -> _highriskSpecialPrefixes = new HighriskSpecialPrefixList ( $ this -> version , $ this -> solution [ 'isoCode' ] ) ; } return $ this -> _highriskSpecialPrefixes ; }
Access the highriskSpecialPrefixes
12,672
public function fetch ( ) { $ params = Values :: of ( array ( ) ) ; $ payload = $ this -> version -> fetch ( 'GET' , $ this -> uri , $ params ) ; return new StepInstance ( $ this -> version , $ payload , $ this -> solution [ 'flowSid' ] , $ this -> solution [ 'engagementSid' ] , $ this -> solution [ 'sid' ] ) ; }
Fetch a StepInstance
12,673
public function getContext ( $ sid ) { return new PublishedTrackContext ( $ this -> version , $ this -> solution [ 'roomSid' ] , $ this -> solution [ 'participantSid' ] , $ sid ) ; }
Constructs a PublishedTrackContext
12,674
public function create ( $ friendlyName , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'FriendlyName' => $ friendlyName , 'ActivitySid' => $ options [ 'activitySid' ] , 'Attributes' => $ options [ 'attributes' ] , ) ) ; $ payload = $ this -> version -> create ( 'POST'...
Create a new WorkerInstance
12,675
protected function getSyncListItems ( ) { if ( ! $ this -> _syncListItems ) { $ this -> _syncListItems = new SyncListItemList ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _syncListItems ; }
Access the syncListItems
12,676
protected function getSyncListPermissions ( ) { if ( ! $ this -> _syncListPermissions ) { $ this -> _syncListPermissions = new SyncListPermissionList ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'sid' ] ) ; } return $ this -> _syncListPermissions ; }
Access the syncListPermissions
12,677
protected function getDependentHostedNumberOrders ( ) { if ( ! $ this -> _dependentHostedNumberOrders ) { $ this -> _dependentHostedNumberOrders = new DependentHostedNumberOrderList ( $ this -> version , $ this -> solution [ 'sid' ] ) ; } return $ this -> _dependentHostedNumberOrders ; }
Access the dependentHostedNumberOrders
12,678
public function create ( $ to , $ mediaUrl , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'To' => $ to , 'MediaUrl' => $ mediaUrl , 'Quality' => $ options [ 'quality' ] , 'StatusCallback' => $ options [ 'statusCallback' ] , 'From' => $ options [ 'from' ] , 'SipAuthUse...
Create a new FaxInstance
12,679
protected function getLocal ( ) { if ( ! $ this -> _local ) { $ this -> _local = new LocalList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'countryCode' ] ) ; } return $ this -> _local ; }
Access the local
12,680
protected function getTollFree ( ) { if ( ! $ this -> _tollFree ) { $ this -> _tollFree = new TollFreeList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'countryCode' ] ) ; } return $ this -> _tollFree ; }
Access the tollFree
12,681
protected function getMobile ( ) { if ( ! $ this -> _mobile ) { $ this -> _mobile = new MobileList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'countryCode' ] ) ; } return $ this -> _mobile ; }
Access the mobile
12,682
protected function getNational ( ) { if ( ! $ this -> _national ) { $ this -> _national = new NationalList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'countryCode' ] ) ; } return $ this -> _national ; }
Access the national
12,683
protected function getVoip ( ) { if ( ! $ this -> _voip ) { $ this -> _voip = new VoipList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'countryCode' ] ) ; } return $ this -> _voip ; }
Access the voip
12,684
protected function getSharedCost ( ) { if ( ! $ this -> _sharedCost ) { $ this -> _sharedCost = new SharedCostList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'countryCode' ] ) ; } return $ this -> _sharedCost ; }
Access the sharedCost
12,685
protected function getMachineToMachine ( ) { if ( ! $ this -> _machineToMachine ) { $ this -> _machineToMachine = new MachineToMachineList ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'countryCode' ] ) ; } return $ this -> _machineToMachine ; }
Access the machineToMachine
12,686
public function create ( $ language , $ query , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'Language' => $ language , 'Query' => $ query , 'Tasks' => $ options [ 'tasks' ] , 'ModelBuild' => $ options [ 'modelBuild' ] , 'Field' => $ options [ 'field' ] , ) ) ; $ payl...
Create a new QueryInstance
12,687
public function setOutgoingApplication ( $ sid , $ params ) { $ this -> outgoingApplicationSid = $ sid ; $ this -> outgoingApplicationParams = $ params ; return $ this ; }
Set the outgoing application of the the grant
12,688
protected function getChannels ( ) { if ( ! $ this -> _channels ) { $ this -> _channels = new ChannelList ( $ this -> version , $ this -> solution [ 'sid' ] ) ; } return $ this -> _channels ; }
Access the channels
12,689
protected function getRoles ( ) { if ( ! $ this -> _roles ) { $ this -> _roles = new RoleList ( $ this -> version , $ this -> solution [ 'sid' ] ) ; } return $ this -> _roles ; }
Access the roles
12,690
protected function getUsers ( ) { if ( ! $ this -> _users ) { $ this -> _users = new UserList ( $ this -> version , $ this -> solution [ 'sid' ] ) ; } return $ this -> _users ; }
Access the users
12,691
protected function getBindings ( ) { if ( ! $ this -> _bindings ) { $ this -> _bindings = new BindingList ( $ this -> version , $ this -> solution [ 'sid' ] ) ; } return $ this -> _bindings ; }
Access the bindings
12,692
public function dial ( $ number = null , $ attributes = array ( ) ) { return $ this -> nest ( new Voice \ Dial ( $ number , $ attributes ) ) ; }
Add Dial child .
12,693
public function enqueue ( $ name = null , $ attributes = array ( ) ) { return $ this -> nest ( new Voice \ Enqueue ( $ name , $ attributes ) ) ; }
Add Enqueue child .
12,694
public function play ( $ url = null , $ attributes = array ( ) ) { return $ this -> nest ( new Voice \ Play ( $ url , $ attributes ) ) ; }
Add Play child .
12,695
public function getContext ( $ sid ) { return new CredentialListMappingContext ( $ this -> version , $ this -> solution [ 'accountSid' ] , $ this -> solution [ 'domainSid' ] , $ sid ) ; }
Constructs a CredentialListMappingContext
12,696
public function getContext ( $ identity ) { return new SyncMapPermissionContext ( $ this -> version , $ this -> solution [ 'serviceSid' ] , $ this -> solution [ 'mapSid' ] , $ identity ) ; }
Constructs a SyncMapPermissionContext
12,697
public function create ( $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'Identity' => Serialize :: map ( $ options [ 'identity' ] , function ( $ e ) { return $ e ; } ) , 'Tag' => Serialize :: map ( $ options [ 'tag' ] , function ( $ e ) { return $ e ; } ) , 'Body' => $ ...
Create a new NotificationInstance
12,698
public function create ( $ publicKey , $ options = array ( ) ) { $ options = new Values ( $ options ) ; $ data = Values :: of ( array ( 'PublicKey' => $ publicKey , 'FriendlyName' => $ options [ 'friendlyName' ] , 'AccountSid' => $ options [ 'accountSid' ] , ) ) ; $ payload = $ this -> version -> create ( 'POST' , $ th...
Create a new PublicKeyInstance
12,699
public function update ( $ url , $ method ) { $ data = Values :: of ( array ( 'Url' => $ url , 'Method' => $ method , ) ) ; $ payload = $ this -> version -> update ( 'POST' , $ this -> uri , array ( ) , $ data ) ; return new MemberInstance ( $ this -> version , $ payload , $ this -> solution [ 'accountSid' ] , $ this -...
Update the MemberInstance