idx
int64 0
60.3k
| question
stringlengths 101
6.21k
| target
stringlengths 7
803
|
|---|---|---|
56,700
|
public function dispatch ( $ event_name , Event $ event ) { $ dir = $ this -> events_dir . $ event_name . '/' ; if ( ! file_exists ( $ dir ) ) { mkdir ( $ dir , 0755 , true ) ; } $ event = serialize ( $ event ) ; file_put_contents ( $ dir . md5 ( $ event ) . '.meta' , $ event ) ; }
|
Store the event and dispatch it later .
|
56,701
|
public static function bootHasKeptFlagBehavior ( ) : void { static :: creating ( function ( $ entity ) { if ( ! $ entity -> is_kept ) { $ entity -> is_kept = false ; } } ) ; static :: updating ( function ( $ entity ) { if ( ! $ entity -> is_kept && $ entity -> setKeptOnUpdate ) { $ entity -> is_kept = true ; } } ) ; }
|
Boot the bootHasKeptFlagBehavior trait for a model .
|
56,702
|
protected function addWithExpired ( Builder $ builder ) : void { $ builder -> macro ( 'withExpired' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withExpired extension to the builder .
|
56,703
|
protected function addUndoClose ( Builder $ builder ) : void { $ builder -> macro ( 'undoClose' , function ( Builder $ builder ) { $ builder -> withClosed ( ) ; return $ builder -> update ( [ 'is_closed' => 0 ] ) ; } ) ; }
|
Add the undoClose extension to the builder .
|
56,704
|
protected function addWithClosed ( Builder $ builder ) : void { $ builder -> macro ( 'withClosed' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withClosed extension to the builder .
|
56,705
|
public static function createFromFile ( $ _ ) { $ files = array_reverse ( func_get_args ( ) ) ; if ( is_array ( $ files [ 0 ] ) ) { $ files = $ files [ 0 ] ; } while ( count ( $ files ) > 0 ) { try { $ file = array_pop ( $ files ) ; if ( ! is_readable ( $ file ) ) { continue ; } $ config = static :: createFromArray ( static :: getFromCache ( $ file , function ( $ file ) { return Loader :: load ( $ file ) ; } ) ) ; if ( null === $ config ) { continue ; } return $ config ; } catch ( Exception $ exception ) { } } return static :: createFromArray ( [ ] ) ; }
|
Create a new ConfigInterface object from a file .
|
56,706
|
public static function create ( $ _ ) { if ( func_num_args ( ) < 1 ) { return static :: createFromArray ( [ ] ) ; } $ arguments = func_get_args ( ) ; if ( is_array ( $ arguments [ 0 ] ) && func_num_args ( ) === 1 ) { return static :: createFromArray ( $ arguments [ 0 ] ) ; } return static :: createFromFile ( $ arguments ) ; }
|
Create a new ConfigInterface object .
|
56,707
|
public static function merge ( $ _ ) { if ( func_num_args ( ) < 1 ) { return static :: createFromArray ( [ ] ) ; } $ arguments = func_get_args ( ) ; if ( is_array ( $ arguments [ 0 ] ) && func_num_args ( ) === 1 ) { return static :: createFromArray ( $ arguments [ 0 ] ) ; } return static :: mergeFromFiles ( $ arguments ) ; }
|
Create a new ConfigInterface object by merging several files together .
|
56,708
|
public static function mergeFromFiles ( $ _ ) { $ files = array_reverse ( func_get_args ( ) ) ; $ data = [ ] ; if ( is_array ( $ files [ 0 ] ) ) { $ files = array_reverse ( $ files [ 0 ] ) ; } while ( count ( $ files ) > 0 ) { try { $ file = array_pop ( $ files ) ; if ( ! is_readable ( $ file ) ) { continue ; } $ new_data = static :: getFromCache ( $ file , function ( $ file ) { return Loader :: load ( $ file ) ; } ) ; if ( null === $ data ) { continue ; } $ data = array_replace_recursive ( $ data , $ new_data ) ; } catch ( Exception $ exception ) { } } return static :: createFromArray ( $ data ) ; }
|
Create a new ConfigInterface object by merging data from several files .
|
56,709
|
public static function createSubConfig ( $ _ ) { if ( func_num_args ( ) < 2 ) { return static :: createFromArray ( [ ] ) ; } $ arguments = func_get_args ( ) ; $ file = array_shift ( $ arguments ) ; $ config = static :: createFromFile ( $ file ) ; return $ config -> getSubConfig ( $ arguments ) ; }
|
Create a new ConfigInterface object from a file and return a sub - portion of it .
|
56,710
|
protected static function getFromCache ( $ identifier , $ fallback ) { if ( ! array_key_exists ( $ identifier , static :: $ configFilesCache ) ) { static :: $ configFilesCache [ $ identifier ] = is_callable ( $ fallback ) ? $ fallback ( $ identifier ) : $ fallback ; } return static :: $ configFilesCache [ $ identifier ] ; }
|
Get a config file from the config file cache .
|
56,711
|
protected function addUndoDraft ( Builder $ builder ) : void { $ builder -> macro ( 'undoDraft' , function ( Builder $ builder ) { $ builder -> withDrafted ( ) ; return $ builder -> update ( [ 'drafted_at' => null ] ) ; } ) ; }
|
Add the undoDraft extension to the builder .
|
56,712
|
protected function addWithDrafted ( Builder $ builder ) : void { $ builder -> macro ( 'withDrafted' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withDrafted extension to the builder .
|
56,713
|
protected function addUndoArchive ( Builder $ builder ) : void { $ builder -> macro ( 'undoArchive' , function ( Builder $ builder ) { $ builder -> withArchived ( ) ; return $ builder -> update ( [ 'archived_at' => null ] ) ; } ) ; }
|
Add the undoArchive extension to the builder .
|
56,714
|
protected function addWithArchived ( Builder $ builder ) : void { $ builder -> macro ( 'withArchived' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withArchived extension to the builder .
|
56,715
|
private function _batchUrl ( $ batchId , $ subPath = '' ) { $ ebid = rawurlencode ( $ batchId ) ; if ( empty ( $ ebid ) ) { throw new \ InvalidArgumentException ( "Empty batch ID given" ) ; } return $ this -> _url ( '/batches/' . $ ebid . $ subPath ) ; }
|
Builds an endpoint URL for the given batch and sub - path .
|
56,716
|
private function _groupUrl ( $ groupId , $ subPath = '' ) { $ egid = rawurlencode ( $ groupId ) ; if ( empty ( $ egid ) ) { throw new \ InvalidArgumentException ( "Empty group ID given" ) ; } return $ this -> _url ( '/groups/' . $ egid . $ subPath ) ; }
|
Builds an endpoint URL for the given group and sub - path .
|
56,717
|
private function _curlHelper ( & $ url , & $ json = null ) { $ headers = [ 'Accept: application/json' , 'Accept-Encoding: gzip, deflate' , 'Connection: keep-alive' , 'Authorization: Bearer ' . $ this -> _token ] ; if ( isset ( $ json ) ) { array_push ( $ headers , 'Content-Type: application/json' ) ; curl_setopt ( $ this -> _curlHandle , CURLOPT_POSTFIELDS , $ json ) ; } curl_setopt ( $ this -> _curlHandle , CURLOPT_URL , $ url ) ; curl_setopt ( $ this -> _curlHandle , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ this -> _curlHandle , CURLOPT_HTTPHEADER , $ headers ) ; curl_setopt ( $ this -> _curlHandle , CURLOPT_USERAGENT , $ this -> _userAgent ) ; $ result = curl_exec ( $ this -> _curlHandle ) ; if ( $ result === false ) { throw new HttpCallException ( curl_error ( $ this -> _curlHandle ) ) ; } $ httpStatus = curl_getinfo ( $ this -> _curlHandle , CURLINFO_HTTP_CODE ) ; if ( isset ( $ this -> _logger ) ) { $ httpTime = curl_getinfo ( $ this -> _curlHandle , CURLINFO_TOTAL_TIME ) ; $ this -> _logger -> debug ( 'Request: {req}; Response (status {status}, took {time}s): {rsp}' , [ 'req' => $ json , 'rsp' => $ result , 'status' => $ httpStatus , 'time' => $ httpTime ] ) ; } switch ( $ httpStatus ) { case 200 : case 201 : break ; case 400 : case 403 : $ e = Deserialize :: error ( $ result ) ; throw new ErrorResponseException ( $ e -> getCode ( ) , $ e -> getText ( ) ) ; case 404 : throw new NotFoundException ( $ url ) ; case 401 : throw new UnauthorizedException ( $ this -> _servicePlanId , $ this -> _token ) ; default : throw new UnexpectedResponseException ( "Unexpected HTTP status $httpStatus" , $ result ) ; } return $ result ; }
|
Helper method that asks cURL to do an HTTP request .
|
56,718
|
private function _get ( $ url ) { curl_setopt ( $ this -> _curlHandle , CURLOPT_HTTPGET , true ) ; curl_setopt ( $ this -> _curlHandle , CURLOPT_CUSTOMREQUEST , 'GET' ) ; return $ this -> _curlHelper ( $ url ) ; }
|
Helper that performs a HTTP GET operation .
|
56,719
|
private function _post ( $ url , & $ json ) { curl_setopt ( $ this -> _curlHandle , CURLOPT_CUSTOMREQUEST , 'POST' ) ; return $ this -> _curlHelper ( $ url , $ json ) ; }
|
Helper that performs a HTTP POST operation .
|
56,720
|
private function _put ( $ url , & $ json ) { curl_setopt ( $ this -> _curlHandle , CURLOPT_CUSTOMREQUEST , 'PUT' ) ; return $ this -> _curlHelper ( $ url , $ json ) ; }
|
Helper that performs a HTTP PUT operation .
|
56,721
|
public function createTextBatch ( Api \ MtBatchTextSmsCreate $ batch ) { $ json = Serialize :: textBatch ( $ batch ) ; $ result = $ this -> _post ( $ this -> _url ( '/batches' ) , $ json ) ; return Deserialize :: batchResponse ( $ result ) ; }
|
Creates a new text batch .
|
56,722
|
public function createBinaryBatch ( Api \ MtBatchBinarySmsCreate $ batch ) { $ json = Serialize :: binaryBatch ( $ batch ) ; $ result = $ this -> _post ( $ this -> _url ( '/batches' ) , $ json ) ; return Deserialize :: batchResponse ( $ result ) ; }
|
Creates a new binary batch .
|
56,723
|
public function createBatchDryRun ( Api \ MtBatchSmsCreate $ batch , $ numRecipients = null ) { if ( $ batch instanceof Api \ MtBatchTextSmsCreate ) { $ json = Serialize :: textBatch ( $ batch ) ; } else if ( $ batch instanceof Api \ MtBatchBinarySmsCreate ) { $ json = Serialize :: binaryBatch ( $ batch ) ; } else { throw new \ InvalidArgumentException ( 'Expected text or binary batch' ) ; } $ path = '/batches/dry_run' ; if ( isset ( $ numRecipients ) ) { $ path .= "?per_recipient=true&number_of_recipients=$numRecipients" ; } $ result = $ this -> _post ( $ this -> _url ( $ path ) , $ json ) ; return Deserialize :: batchDryRun ( $ result ) ; }
|
Simulates sending the given batch .
|
56,724
|
public function replaceTextBatch ( $ batchId , Api \ MtBatchTextSmsCreate $ batch ) { $ json = Serialize :: textBatch ( $ batch ) ; $ result = $ this -> _put ( $ this -> _batchUrl ( $ batchId ) , $ json ) ; return Deserialize :: batchResponse ( $ result ) ; }
|
Replaces the batch with the given ID with the given text batch .
|
56,725
|
public function replaceBinaryBatch ( $ batchId , Api \ MtBatchBinarySmsCreate $ batch ) { $ json = Serialize :: binaryBatch ( $ batch ) ; $ result = $ this -> _put ( $ this -> _batchUrl ( $ batchId ) , $ json ) ; return Deserialize :: batchResponse ( $ result ) ; }
|
Replaces the batch with the given ID with the given binary batch .
|
56,726
|
public function updateTextBatch ( $ batchId , Api \ MtBatchTextSmsUpdate $ batch ) { $ json = Serialize :: textBatchUpdate ( $ batch ) ; $ result = $ this -> _post ( $ this -> _batchUrl ( $ batchId ) , $ json ) ; return Deserialize :: batchResponse ( $ result ) ; }
|
Updates the text batch with the given identifier .
|
56,727
|
public function updateBinaryBatch ( $ batchId , Api \ MtBatchBinarySmsUpdate $ batch ) { $ json = Serialize :: binaryBatchUpdate ( $ batch ) ; $ result = $ this -> _post ( $ this -> _batchUrl ( $ batchId ) , $ json ) ; return Deserialize :: batchResponse ( $ result ) ; }
|
Updates the binary batch with the given identifier .
|
56,728
|
public function replaceBatchTags ( $ batchId , array $ tags ) { $ json = Serialize :: tags ( $ tags ) ; $ result = $ this -> _put ( $ this -> _batchUrl ( $ batchId , '/tags' ) , $ json ) ; return Deserialize :: tags ( $ result ) ; }
|
Replaces the tags of the given batch .
|
56,729
|
public function updateBatchTags ( $ batchId , array $ tagsToAdd , array $ tagsToRemove ) { $ json = Serialize :: tagsUpdate ( $ tagsToAdd , $ tagsToRemove ) ; $ result = $ this -> _post ( $ this -> _batchUrl ( $ batchId , '/tags' ) , $ json ) ; return Deserialize :: tags ( $ result ) ; }
|
Updates the tags of the given batch .
|
56,730
|
public function fetchBatch ( $ batchId ) { $ result = $ this -> _get ( $ this -> _batchUrl ( $ batchId ) ) ; return Deserialize :: batchResponse ( $ result ) ; }
|
Fetches the batch with the given batch identifier .
|
56,731
|
public function fetchBatches ( BatchFilter $ filter = null ) { return new Api \ Pages ( function ( $ page ) use ( $ filter ) { $ params = [ "page=$page" ] ; if ( ! is_null ( $ filter ) ) { if ( null != $ filter -> getPageSize ( ) ) { array_push ( $ params , 'page_size=' . $ filter -> getPageSize ( ) ) ; } if ( null != $ filter -> getSenders ( ) ) { $ val = urlencode ( join ( ',' , $ filter -> getSenders ( ) ) ) ; array_push ( $ params , 'from=' . $ val ) ; } if ( null != $ filter -> getTags ( ) ) { $ val = urlencode ( join ( ',' , $ filter -> getTags ( ) ) ) ; array_push ( $ params , 'tags=' . $ val ) ; } if ( null != $ filter -> getStartDate ( ) ) { $ val = $ filter -> getStartDate ( ) -> format ( 'Y-m-d' ) ; array_push ( $ params , 'start_date=' . $ val ) ; } if ( null != $ filter -> getEndDate ( ) ) { $ val = $ filter -> getEndDate ( ) -> format ( 'Y-m-d' ) ; array_push ( $ params , 'end_date=' . $ val ) ; } } $ q = join ( '&' , $ params ) ; $ result = $ this -> _get ( $ this -> _url ( '/batches?' . $ q ) ) ; return Deserialize :: batchesPage ( $ result ) ; } ) ; }
|
Fetch the batches matching the given filter .
|
56,732
|
public function fetchBatchTags ( $ batchId ) { $ result = $ this -> _get ( $ this -> _batchUrl ( $ batchId , '/tags' ) ) ; return Deserialize :: tags ( $ result ) ; }
|
Fetches the tags associated with the given batch .
|
56,733
|
public function fetchDeliveryReport ( $ batchId , $ type = null , array $ status = null , array $ code = null ) { $ params = [ ] ; if ( isset ( $ type ) ) { array_push ( $ params , 'type=' . $ type ) ; } if ( ! empty ( $ status ) ) { $ val = urlencode ( join ( ',' , $ status ) ) ; array_push ( $ params , 'status=' . $ val ) ; } if ( ! empty ( $ code ) ) { $ val = urlencode ( join ( ',' , $ code ) ) ; array_push ( $ params , 'code=' . $ val ) ; } $ path = '/delivery_report' ; if ( ! empty ( $ params ) ) { $ path .= '?' . join ( '&' , $ params ) ; } $ result = $ this -> _get ( $ this -> _batchUrl ( $ batchId , $ path ) ) ; return Deserialize :: batchDeliveryReport ( $ result ) ; }
|
Fetches a delivery report for a batch .
|
56,734
|
public function fetchRecipientDeliveryReport ( $ batchId , $ recipient ) { $ path = '/delivery_report/' . urlencode ( $ recipient ) ; $ result = $ this -> _get ( $ this -> _batchUrl ( $ batchId , $ path ) ) ; return Deserialize :: batchRecipientDeliveryReport ( $ result ) ; }
|
Fetches a delivery report for a specific batch recipient .
|
56,735
|
public function createGroup ( Api \ GroupCreate $ group ) { $ json = Serialize :: group ( $ group ) ; $ result = $ this -> _post ( $ this -> _url ( '/groups' ) , $ json ) ; return Deserialize :: groupResponse ( $ result ) ; }
|
Creates the given group .
|
56,736
|
public function replaceGroupTags ( $ groupId , array $ tags ) { $ json = Serialize :: tags ( $ tags ) ; $ result = $ this -> _put ( $ this -> _groupUrl ( $ groupId , '/tags' ) , $ json ) ; return Deserialize :: tags ( $ result ) ; }
|
Replaces the tags of the given group .
|
56,737
|
public function replaceGroup ( $ groupId , Api \ GroupCreate $ group ) { $ json = Serialize :: group ( $ group ) ; $ result = $ this -> _put ( $ this -> _groupUrl ( $ groupId ) , $ json ) ; return Deserialize :: groupResponse ( $ result ) ; }
|
Replaces the group with the given group identifier .
|
56,738
|
public function updateGroup ( $ groupId , Api \ GroupUpdate $ group ) { $ json = Serialize :: groupUpdate ( $ group ) ; $ result = $ this -> _post ( $ this -> _groupUrl ( $ groupId ) , $ json ) ; return Deserialize :: groupResponse ( $ result ) ; }
|
Updates the group with the given identifier .
|
56,739
|
public function updateGroupTags ( $ groupId , array $ tagsToAdd , array $ tagsToRemove ) { $ json = Serialize :: tagsUpdate ( $ tagsToAdd , $ tagsToRemove ) ; $ result = $ this -> _post ( $ this -> _groupUrl ( $ groupId , '/tags' ) , $ json ) ; return Deserialize :: tags ( $ result ) ; }
|
Updates the tags of the given group .
|
56,740
|
public function fetchGroup ( $ groupId ) { $ result = $ this -> _get ( $ this -> _groupUrl ( $ groupId ) ) ; return Deserialize :: groupResponse ( $ result ) ; }
|
Fetches the group with the given group identifier .
|
56,741
|
public function fetchGroups ( GroupFilter $ filter = null ) { return new Api \ Pages ( function ( $ page ) use ( $ filter ) { $ params = [ "page=$page" ] ; if ( ! is_null ( $ filter ) ) { if ( null != $ filter -> getPageSize ( ) ) { array_push ( $ params , 'page_size=' . $ filter -> getPageSize ( ) ) ; } if ( null != $ filter -> getTags ( ) ) { $ val = urlencode ( join ( ',' , $ filter -> getTags ( ) ) ) ; array_push ( $ params , 'tags=' . $ val ) ; } } $ q = join ( '&' , $ params ) ; $ result = $ this -> _get ( $ this -> _url ( '/groups?' . $ q ) ) ; return Deserialize :: groupsPage ( $ result ) ; } ) ; }
|
Fetch the groups matching the given filter .
|
56,742
|
public function fetchGroupMembers ( $ groupId ) { $ result = $ this -> _get ( $ this -> _groupUrl ( $ groupId , '/members' ) ) ; return Deserialize :: groupMembers ( $ result ) ; }
|
Fetches the members that belong to the given group .
|
56,743
|
public function fetchGroupTags ( $ groupId ) { $ result = $ this -> _get ( $ this -> _groupUrl ( $ groupId , '/tags' ) ) ; return Deserialize :: tags ( $ result ) ; }
|
Fetches the tags associated with the given group .
|
56,744
|
public function fetchInbound ( $ inboundId ) { $ eiid = rawurlencode ( $ inboundId ) ; if ( empty ( $ eiid ) ) { throw new \ InvalidArgumentException ( "Empty inbound ID given" ) ; } $ result = $ this -> _get ( $ this -> _url ( "/inbounds/$eiid" ) ) ; return Deserialize :: moSms ( $ result ) ; }
|
Fetches the inbound message with the given identifier .
|
56,745
|
public function fetchInbounds ( InboundsFilter $ filter = null ) { return new Api \ Pages ( function ( $ page ) use ( $ filter ) { $ params = [ "page=$page" ] ; if ( ! is_null ( $ filter ) ) { if ( null != $ filter -> getPageSize ( ) ) { array_push ( $ params , 'page_size=' . $ filter -> getPageSize ( ) ) ; } if ( null != $ filter -> getRecipients ( ) ) { $ val = urlencode ( join ( ',' , $ filter -> getRecipients ( ) ) ) ; array_push ( $ params , 'to=' . $ val ) ; } if ( null != $ filter -> getStartDate ( ) ) { $ val = $ filter -> getStartDate ( ) -> format ( 'Y-m-d' ) ; array_push ( $ params , 'start_date=' . $ val ) ; } if ( null != $ filter -> getEndDate ( ) ) { $ val = $ filter -> getEndDate ( ) -> format ( 'Y-m-d' ) ; array_push ( $ params , 'end_date=' . $ val ) ; } } $ q = join ( '&' , $ params ) ; $ result = $ this -> _get ( $ this -> _url ( '/inbounds?' . $ q ) ) ; return Deserialize :: inboundsPage ( $ result ) ; } ) ; }
|
Fetch inbound messages matching the given filter .
|
56,746
|
protected function parseSchema ( $ data , $ key ) { $ this -> parseDefined ( $ key ) ; if ( array_key_exists ( self :: REQUIRED_KEY , $ data ) ) { $ this -> parseRequired ( $ key , $ data [ self :: REQUIRED_KEY ] ) ; } if ( array_key_exists ( self :: DEFAULT_VALUE , $ data ) ) { $ this -> parseDefault ( $ key , $ data [ self :: DEFAULT_VALUE ] ) ; } }
|
Parse a single provided schema entry .
|
56,747
|
protected function addWithNotInvited ( Builder $ builder ) : void { $ builder -> macro ( 'withNotInvited' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withNotInvited extension to the builder .
|
56,748
|
protected function addWithEnded ( Builder $ builder ) : void { $ builder -> macro ( 'withEnded' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withEnded extension to the builder .
|
56,749
|
protected function addUndoVerify ( Builder $ builder ) : void { $ builder -> macro ( 'undoVerify' , function ( Builder $ builder ) { return $ builder -> update ( [ 'verified_at' => null ] ) ; } ) ; }
|
Add the undoVerify extension to the builder .
|
56,750
|
protected function addWithNotVerified ( Builder $ builder ) : void { $ builder -> macro ( 'withNotVerified' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withNotVerified extension to the builder .
|
56,751
|
protected function addUndoPublish ( Builder $ builder ) : void { $ builder -> macro ( 'undoPublish' , function ( Builder $ builder ) { return $ builder -> update ( [ 'is_published' => 0 ] ) ; } ) ; }
|
Add the undoPublish extension to the builder .
|
56,752
|
protected function addWithNotPublished ( Builder $ builder ) : void { $ builder -> macro ( 'withNotPublished' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withNotPublished extension to the builder .
|
56,753
|
protected function addUndoInvite ( Builder $ builder ) : void { $ builder -> macro ( 'undoInvite' , function ( Builder $ builder ) { return $ builder -> update ( [ 'is_invited' => 0 ] ) ; } ) ; }
|
Add the undoInvite extension to the builder .
|
56,754
|
protected function addUndoExpire ( Builder $ builder ) : void { $ builder -> macro ( 'undoExpire' , function ( Builder $ builder ) { $ builder -> withExpired ( ) ; return $ builder -> update ( [ 'is_expired' => 0 ] ) ; } ) ; }
|
Add the undoExpire extension to the builder .
|
56,755
|
public static function fromRegistry ( ManagerRegistry $ registry ) { $ drivers = array ( ) ; foreach ( $ registry -> getManagers ( ) as $ manager ) { $ drivers [ ] = self :: fromManager ( $ manager ) ; } return new DriverChain ( $ drivers ) ; }
|
Create a driver from a Doctrine registry
|
56,756
|
public static function fromMetadataDriver ( MappingDriver $ omDriver ) { if ( $ omDriver instanceof MappingDriverChain ) { $ drivers = array ( ) ; foreach ( $ omDriver -> getDrivers ( ) as $ nestedOmDriver ) { $ drivers [ ] = self :: fromMetadataDriver ( $ nestedOmDriver ) ; } return new DriverChain ( $ drivers ) ; } if ( $ omDriver instanceof DoctrineAnnotationDriver ) { return new AnnotationDriver ( $ omDriver -> getReader ( ) ) ; } if ( $ omDriver instanceof DoctrineFileDriver ) { $ reflClass = new \ ReflectionClass ( $ omDriver ) ; $ driverName = $ reflClass -> getShortName ( ) ; if ( $ omDriver instanceof SimplifiedYamlDriver || $ omDriver instanceof SimplifiedXmlDriver ) { $ driverName = str_replace ( 'Simplified' , '' , $ driverName ) ; } $ class = 'Prezent\\Doctrine\\Translatable\\Mapping\\Driver\\' . $ driverName ; if ( class_exists ( $ class ) ) { return new $ class ( $ omDriver -> getLocator ( ) ) ; } } throw new \ InvalidArgumentException ( 'Cannot adapt Doctrine driver of class ' . get_class ( $ omDriver ) ) ; }
|
Create a driver from a Doctrine metadata driver
|
56,757
|
protected function addKeep ( Builder $ builder ) : void { $ builder -> macro ( 'keep' , function ( Builder $ builder ) { $ builder -> withNotKept ( ) ; return $ builder -> update ( [ 'is_kept' => 1 ] ) ; } ) ; }
|
Add the keep extension to the builder .
|
56,758
|
protected function addUndoKeep ( Builder $ builder ) : void { $ builder -> macro ( 'undoKeep' , function ( Builder $ builder ) { return $ builder -> update ( [ 'is_kept' => 0 ] ) ; } ) ; }
|
Add the undoKeep extension to the builder .
|
56,759
|
protected function addWithNotKept ( Builder $ builder ) : void { $ builder -> macro ( 'withNotKept' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withNotKept extension to the builder .
|
56,760
|
protected function addWithoutNotKept ( Builder $ builder ) : void { $ builder -> macro ( 'withoutNotKept' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) -> where ( 'is_kept' , 1 ) ; } ) ; }
|
Add the withoutNotKept extension to the builder .
|
56,761
|
protected function addOnlyNotKept ( Builder $ builder ) : void { $ builder -> macro ( 'onlyNotKept' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) -> where ( 'is_kept' , 0 ) ; } ) ; }
|
Add the onlyNotKept extension to the builder .
|
56,762
|
public function getDefinedOptions ( ) { if ( ! $ this -> defined ) { return null ; } if ( $ this -> defined instanceof ConfigInterface ) { return $ this -> defined -> getArrayCopy ( ) ; } return ( array ) $ this -> defined ; }
|
Get the set of defined options .
|
56,763
|
public function getDefaultOptions ( ) { if ( ! $ this -> defaults ) { return null ; } if ( $ this -> defaults instanceof ConfigInterface ) { return $ this -> defaults -> getArrayCopy ( ) ; } return ( array ) $ this -> defaults ; }
|
Get the set of default options .
|
56,764
|
public function getRequiredOptions ( ) { if ( ! $ this -> required ) { return null ; } if ( $ this -> required instanceof ConfigInterface ) { return $ this -> required -> getArrayCopy ( ) ; } return ( array ) $ this -> required ; }
|
Get the set of required options .
|
56,765
|
private static function _createBatchHelper ( Api \ MtBatchSmsCreate & $ batch ) { $ fields = [ 'from' => $ batch -> getSender ( ) , 'to' => $ batch -> getRecipients ( ) ] ; if ( null != $ batch -> getDeliveryReport ( ) ) { $ fields [ 'delivery_report' ] = $ batch -> getDeliveryReport ( ) ; } if ( null != $ batch -> getSendAt ( ) ) { $ fields [ 'send_at' ] = Serialize :: _dateTime ( $ batch -> getSendAt ( ) ) ; } if ( null != $ batch -> getExpireAt ( ) ) { $ fields [ 'expire_at' ] = Serialize :: _dateTime ( $ batch -> getExpireAt ( ) ) ; } if ( null != $ batch -> getTags ( ) ) { $ fields [ 'tags' ] = $ batch -> getTags ( ) ; } if ( null != $ batch -> getCallbackUrl ( ) ) { $ fields [ 'callback_url' ] = $ batch -> getCallbackUrl ( ) ; } return $ fields ; }
|
Helper that prepares the fields of a batch creates for JSON serialization .
|
56,766
|
public static function textBatch ( Api \ MtBatchTextSmsCreate $ batch ) { $ fields = Serialize :: _createBatchHelper ( $ batch ) ; $ fields [ 'type' ] = 'mt_text' ; $ fields [ 'body' ] = $ batch -> getBody ( ) ; if ( ! empty ( $ batch -> getParameters ( ) ) ) { $ fields [ 'parameters' ] = $ batch -> getParameters ( ) ; } return Serialize :: _toJson ( $ fields ) ; }
|
Serializes the given text batch into JSON .
|
56,767
|
public static function binaryBatch ( Api \ MtBatchBinarySmsCreate $ batch ) { $ fields = Serialize :: _createBatchHelper ( $ batch ) ; $ fields [ 'type' ] = 'mt_binary' ; $ fields [ 'body' ] = base64_encode ( $ batch -> getBody ( ) ) ; $ fields [ 'udh' ] = bin2hex ( $ batch -> getUdh ( ) ) ; return Serialize :: _toJson ( $ fields ) ; }
|
Serializes the given binary batch into JSON .
|
56,768
|
private static function _batchUpdateHelper ( Api \ MtBatchSmsUpdate $ batch ) { $ fields = [ ] ; if ( ! empty ( $ batch -> getRecipientInsertions ( ) ) ) { $ fields [ 'to_add' ] = $ batch -> getRecipientInsertions ( ) ; } if ( ! empty ( $ batch -> getRecipientRemovals ( ) ) ) { $ fields [ 'to_remove' ] = $ batch -> getRecipientRemovals ( ) ; } if ( null != $ batch -> getSender ( ) ) { $ fields [ 'from' ] = $ batch -> getSender ( ) ; } if ( null != $ batch -> getDeliveryReport ( ) ) { if ( $ batch -> getDeliveryReport ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'delivery_report' ] = null ; } else { $ fields [ 'delivery_report' ] = $ batch -> getDeliveryReport ( ) ; } } if ( null != $ batch -> getSendAt ( ) ) { if ( $ batch -> getSendAt ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'send_at' ] = null ; } else { $ fields [ 'send_at' ] = Serialize :: _dateTime ( $ batch -> getSendAt ( ) ) ; } } if ( null != $ batch -> getExpireAt ( ) ) { if ( $ batch -> getExpireAt ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'expire_at' ] = null ; } else { $ fields [ 'expire_at' ] = Serialize :: _dateTime ( $ batch -> getExpireAt ( ) ) ; } } if ( null != $ batch -> getCallbackUrl ( ) ) { if ( $ batch -> getCallbackUrl ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'callback_url' ] = null ; } else { $ fields [ 'callback_url' ] = $ batch -> getCallbackUrl ( ) ; } } return $ fields ; }
|
Helper that prepares the given batch for serialization
|
56,769
|
public static function textBatchUpdate ( Api \ MtBatchTextSmsUpdate $ batch ) { $ fields = Serialize :: _batchUpdateHelper ( $ batch ) ; $ fields [ 'type' ] = 'mt_text' ; if ( null != $ batch -> getBody ( ) ) { $ fields [ 'body' ] = $ batch -> getBody ( ) ; } if ( null != $ batch -> getParameters ( ) ) { if ( $ batch -> getParameters ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'parameters' ] = null ; } else { $ fields [ 'parameters' ] = $ batch -> getParameters ( ) ; } } return Serialize :: _toJson ( $ fields ) ; }
|
Serializes the given text batch update into JSON .
|
56,770
|
public static function binaryBatchUpdate ( Api \ MtBatchBinarySmsUpdate $ batch ) { $ fields = Serialize :: _batchUpdateHelper ( $ batch ) ; $ fields [ 'type' ] = 'mt_binary' ; if ( null != $ batch -> getBody ( ) ) { $ fields [ 'body' ] = base64_encode ( $ batch -> getBody ( ) ) ; } if ( null != $ batch -> getUdh ( ) ) { $ fields [ 'udh' ] = bin2hex ( $ batch -> getUdh ( ) ) ; } return Serialize :: _toJson ( $ fields ) ; }
|
Serializes the given binary batch update into JSON .
|
56,771
|
public static function _groupAutoUpdateHelper ( Api \ GroupAutoUpdate $ autoUpdate ) { $ fields = [ 'to' => $ autoUpdate -> getRecipient ( ) ] ; if ( null != $ autoUpdate -> getAddFirstWord ( ) ) { $ fields [ 'add' ] [ 'first_word' ] = $ autoUpdate -> getAddFirstWord ( ) ; } if ( null != $ autoUpdate -> getAddSecondWord ( ) ) { $ fields [ 'add' ] [ 'second_word' ] = $ autoUpdate -> getAddSecondWord ( ) ; } if ( null != $ autoUpdate -> getRemoveFirstWord ( ) ) { $ fields [ 'remove' ] [ 'first_word' ] = $ autoUpdate -> getRemoveFirstWord ( ) ; } if ( null != $ autoUpdate -> getRemoveSecondWord ( ) ) { $ fields [ 'remove' ] [ 'second_word' ] = $ autoUpdate -> getRemoveSecondWord ( ) ; } return $ fields ; }
|
Helper that prepares the given group auto update for JSON serialization .
|
56,772
|
public static function group ( Api \ GroupCreate $ group ) { $ fields = [ ] ; if ( $ group -> getName ( ) != null ) { $ fields [ 'name' ] = $ group -> getName ( ) ; } if ( ! empty ( $ group -> getMembers ( ) ) ) { $ fields [ 'members' ] = $ group -> getMembers ( ) ; } if ( ! empty ( $ group -> getChildGroups ( ) ) ) { $ fields [ 'child_groups' ] = $ group -> getChildGroups ( ) ; } if ( $ group -> getAutoUpdate ( ) != null ) { $ fields [ 'auto_update' ] = Serialize :: _groupAutoUpdateHelper ( $ group -> getAutoUpdate ( ) ) ; } if ( ! empty ( $ group -> getTags ( ) ) ) { $ fields [ 'tags' ] = $ group -> getTags ( ) ; } return Serialize :: _toJson ( $ fields ) ; }
|
Serializes the given group create object to JSON .
|
56,773
|
public static function groupUpdate ( Api \ GroupUpdate $ groupUpdate ) { $ fields = [ ] ; if ( null != $ groupUpdate -> getName ( ) ) { $ fields [ 'name' ] = $ groupUpdate -> getName ( ) === Api \ Reset :: reset ( ) ? null : $ groupUpdate -> getName ( ) ; } if ( ! empty ( $ groupUpdate -> getMemberInsertions ( ) ) ) { $ fields [ 'add' ] = $ groupUpdate -> getMemberInsertions ( ) ; } if ( ! empty ( $ groupUpdate -> getMemberRemovals ( ) ) ) { $ fields [ 'remove' ] = $ groupUpdate -> getMemberRemovals ( ) ; } if ( ! empty ( $ groupUpdate -> getChildGroupInsertions ( ) ) ) { $ fields [ 'child_groups_add' ] = $ groupUpdate -> getChildGroupInsertions ( ) ; } if ( ! empty ( $ groupUpdate -> getChildGroupRemovals ( ) ) ) { $ fields [ 'child_groups_remove' ] = $ groupUpdate -> getChildGroupRemovals ( ) ; } if ( null != $ groupUpdate -> getAddFromGroup ( ) ) { $ fields [ 'add_from_group' ] = $ groupUpdate -> getAddFromGroup ( ) ; } if ( null != $ groupUpdate -> getRemoveFromGroup ( ) ) { $ fields [ 'remove_from_group' ] = $ groupUpdate -> getRemoveFromGroup ( ) ; } if ( null != $ groupUpdate -> getAutoUpdate ( ) ) { if ( $ groupUpdate -> getAutoUpdate ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'auto_update' ] = null ; } else { $ fields [ 'auto_update' ] = Serialize :: _groupAutoUpdateHelper ( $ groupUpdate -> getAutoUpdate ( ) ) ; } } return empty ( $ fields ) ? '{}' : Serialize :: _toJson ( $ fields ) ; }
|
Serializes the given group update object to JSON .
|
56,774
|
protected function addActivate ( Builder $ builder ) : void { $ builder -> macro ( 'activate' , function ( Builder $ builder ) { $ builder -> withNotActivated ( ) ; return $ builder -> update ( [ 'is_active' => 1 ] ) ; } ) ; }
|
Add the activate extension to the builder .
|
56,775
|
protected function addUndoActivate ( Builder $ builder ) : void { $ builder -> macro ( 'undoActivate' , function ( Builder $ builder ) { return $ builder -> update ( [ 'is_active' => 0 ] ) ; } ) ; }
|
Add the undoActivate extension to the builder .
|
56,776
|
protected function addWithNotActivated ( Builder $ builder ) : void { $ builder -> macro ( 'withNotActivated' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withNotActivated extension to the builder .
|
56,777
|
protected function addWithoutNotActivated ( Builder $ builder ) : void { $ builder -> macro ( 'withoutNotActivated' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) -> where ( 'is_active' , 1 ) ; } ) ; }
|
Add the withoutNotActivated extension to the builder .
|
56,778
|
protected function addOnlyNotActivated ( Builder $ builder ) : void { $ builder -> macro ( 'onlyNotActivated' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) -> where ( 'is_active' , 0 ) ; } ) ; }
|
Add the onlyNotActivated extension to the builder .
|
56,779
|
public function getHeaders ( bool $ implode = false , bool $ ucwords = false ) : array { if ( $ ucwords && $ implode ) { $ headers = [ ] ; foreach ( $ this -> headers as $ key => $ val ) { $ key = ucwords ( $ key , '-' ) ; $ headers [ $ key ] = implode ( ', ' , $ val ) ; } return $ headers ; } elseif ( $ ucwords ) { $ headers = [ ] ; foreach ( $ this -> headers as $ key => $ val ) { $ key = ucwords ( $ key , '-' ) ; $ headers [ $ key ] = $ val ; } return $ headers ; } elseif ( $ implode ) { $ headers = [ ] ; foreach ( $ this -> headers as $ key => $ val ) { $ headers [ $ key ] = implode ( ', ' , $ val ) ; } return $ headers ; } return $ this -> headers ; }
|
get all headers
|
56,780
|
public static function isDefaultPort ( UriInterface $ uri ) : bool { return $ uri -> getPort ( ) === null || ( isset ( self :: $ defaultPorts [ $ uri -> getScheme ( ) ] ) && $ uri -> getPort ( ) === self :: $ defaultPorts [ $ uri -> getScheme ( ) ] ) ; }
|
Whether the URI has the default port of the current scheme .
|
56,781
|
public static function fromParts ( array $ parts ) : UriInterface { $ uri = new self ( ) ; $ uri -> applyParts ( $ parts ) ; $ uri -> validateState ( ) ; return $ uri ; }
|
Creates a URI from a hash of parse_url components .
|
56,782
|
protected function addUndoEnd ( Builder $ builder ) : void { $ builder -> macro ( 'undoEnd' , function ( Builder $ builder ) { $ builder -> withEnded ( ) ; return $ builder -> update ( [ 'ended_at' => null ] ) ; } ) ; }
|
Add the undoEnd extension to the builder .
|
56,783
|
public function getTranslatableMetadata ( $ className ) { if ( array_key_exists ( $ className , $ this -> cache ) ) { return $ this -> cache [ $ className ] ; } if ( $ metadata = $ this -> metadataFactory -> getMetadataForClass ( $ className ) ) { if ( ! $ metadata -> reflection -> isAbstract ( ) ) { $ metadata -> validate ( ) ; } } $ this -> cache [ $ className ] = $ metadata ; return $ metadata ; }
|
Get translatable metadata
|
56,784
|
private function hasUniqueConstraint ( ClassMetadata $ mapping , array $ columns ) { if ( ! array_diff ( $ mapping -> getIdentifierColumnNames ( ) , $ columns ) ) { return true ; } if ( ! isset ( $ mapping -> table [ 'uniqueConstraints' ] ) ) { return false ; } foreach ( $ mapping -> table [ 'uniqueConstraints' ] as $ constraint ) { if ( ! array_diff ( $ constraint [ 'columns' ] , $ columns ) ) { return true ; } } return false ; }
|
Check if an unique constraint has been defined
|
56,785
|
private function readMapping ( $ className ) { $ file = $ this -> getMappingFile ( $ className ) ; return $ file ? $ this -> parse ( $ file ) : null ; }
|
Reads the configuration for the given classname .
|
56,786
|
protected function addUndoAccept ( Builder $ builder ) : void { $ builder -> macro ( 'undoAccept' , function ( Builder $ builder ) { return $ builder -> update ( [ 'accepted_at' => null ] ) ; } ) ; }
|
Add the undoAccept extension to the builder .
|
56,787
|
protected function addWithNotAccepted ( Builder $ builder ) : void { $ builder -> macro ( 'withNotAccepted' , function ( Builder $ builder ) { return $ builder -> withoutGlobalScope ( $ this ) ; } ) ; }
|
Add the withNotAccepted extension to the builder .
|
56,788
|
public function query ( $ url , $ data = null , $ headers = array ( ) , $ method = 'get' , $ timeout = null ) { $ token = $ this -> getToken ( ) ; if ( array_key_exists ( 'expires_in' , $ token ) && $ token [ 'created' ] + $ token [ 'expires_in' ] < time ( ) + 20 ) { if ( ! $ this -> getOption ( 'userefresh' ) ) { return false ; } $ token = $ this -> refreshToken ( $ token [ 'refresh_token' ] ) ; } if ( ! $ this -> getOption ( 'authmethod' ) || $ this -> getOption ( 'authmethod' ) == 'bearer' ) { $ headers [ 'Authorization' ] = 'Bearer ' . $ token [ 'access_token' ] ; } elseif ( $ this -> getOption ( 'authmethod' ) == 'get' ) { if ( strpos ( $ url , '?' ) ) { $ url .= '&' ; } else { $ url .= '?' ; } $ url .= $ this -> getOption ( 'getparam' ) ? $ this -> getOption ( 'getparam' ) : 'access_token' ; $ url .= '=' . $ token [ 'access_token' ] ; } switch ( $ method ) { case 'head' : case 'get' : case 'delete' : case 'trace' : $ response = $ this -> http -> $ method ( $ url , $ headers , $ timeout ) ; break ; case 'post' : case 'put' : case 'patch' : $ response = $ this -> http -> $ method ( $ url , $ data , $ headers , $ timeout ) ; break ; default : throw new InvalidArgumentException ( 'Unknown HTTP request method: ' . $ method . '.' ) ; } if ( $ response -> code < 200 || $ response -> code >= 400 ) { throw new RuntimeException ( 'Error code ' . $ response -> code . ' received requesting data: ' . $ response -> body . '.' ) ; } return $ response ; }
|
Send a signed Oauth request .
|
56,789
|
public function setToken ( $ value ) { if ( \ is_array ( $ value ) && ! array_key_exists ( 'expires_in' , $ value ) && array_key_exists ( 'expires' , $ value ) ) { $ value [ 'expires_in' ] = $ value [ 'expires' ] ; unset ( $ value [ 'expires' ] ) ; } $ this -> setOption ( 'accesstoken' , $ value ) ; return $ this ; }
|
Set an option for the Client instance .
|
56,790
|
protected function loadUri ( $ uri ) { try { ob_start ( ) ; $ data = include ( $ uri ) ; ob_end_clean ( ) ; return $ data ; } catch ( Exception $ exception ) { throw new FailedToLoadConfigException ( sprintf ( _ ( 'Could not include PHP config file "%1$s". Reason: "%2$s".' ) , $ uri , $ exception -> getMessage ( ) ) , $ exception -> getCode ( ) , $ exception ) ; } }
|
Load the contents of an resource identified by an URI .
|
56,791
|
public function getKey ( $ _ ) { $ keys = $ this -> validateKeys ( func_get_args ( ) ) ; $ keys = array_reverse ( $ keys ) ; $ array = $ this -> getArrayCopy ( ) ; while ( count ( $ keys ) > 0 ) { $ key = array_pop ( $ keys ) ; $ array = $ array [ $ key ] ; } return $ array ; }
|
Get the value of a specific key .
|
56,792
|
public function hasKey ( $ _ ) { try { $ keys = array_reverse ( $ this -> getKeyArguments ( func_get_args ( ) ) ) ; $ array = $ this -> getArrayCopy ( ) ; while ( count ( $ keys ) > 0 ) { $ key = array_pop ( $ keys ) ; if ( ! array_key_exists ( $ key , $ array ) ) { return false ; } $ array = $ array [ $ key ] ; } } catch ( Exception $ exception ) { return false ; } return true ; }
|
Check whether the Config has a specific key .
|
56,793
|
public function getSubConfig ( $ _ ) { $ keys = $ this -> validateKeys ( func_get_args ( ) ) ; $ subConfig = clone $ this ; $ subConfig -> reduceToSubKey ( $ keys ) ; return $ subConfig ; }
|
Get a new config at a specific sub - level .
|
56,794
|
public function validateKeys ( $ _ ) { $ keys = $ this -> getKeyArguments ( func_get_args ( ) ) ; if ( ! $ this -> hasKey ( $ keys ) ) { throw new KeyNotFoundException ( sprintf ( _ ( 'The configuration key %1$s does not exist.' ) , implode ( '->' , $ keys ) ) ) ; } return $ keys ; }
|
Validate a set of keys to make sure they exist .
|
56,795
|
protected function getKeyArguments ( $ arguments ) { $ keys = [ ] ; foreach ( $ arguments as $ argument ) { if ( is_array ( $ argument ) ) { $ keys = array_merge ( $ keys , $ this -> getKeyArguments ( $ argument ) ) ; } if ( is_string ( $ argument ) ) { $ keys = array_merge ( $ keys , $ this -> parseKeysString ( $ argument ) ) ; } } return $ keys ; }
|
Recursively extract the configuration key arguments from an arbitrary array .
|
56,796
|
protected function parseKeysString ( $ keyString ) { $ normalizedString = str_replace ( $ this -> delimiter , $ this -> delimiter [ 0 ] , $ keyString ) ; return ( array ) explode ( $ this -> delimiter [ 0 ] , $ normalizedString ) ; }
|
Extract individual keys from a delimited string .
|
56,797
|
public function toRequestArray ( string $ uri = '' ) : array { $ r = [ ] ; if ( ! empty ( $ this -> raw ) ) { $ priorities = [ ] ; foreach ( $ this -> raw as $ cookie ) { if ( $ cookie -> isValid ( $ uri ) ) { $ priority = strlen ( $ cookie -> domain ) ; if ( ! isset ( $ r [ $ cookie -> name ] ) || $ priorities [ $ cookie -> name ] < $ priority ) { $ r [ $ cookie -> name ] = $ cookie -> value ; $ priorities [ $ cookie -> name ] = $ priority ; } } } } return $ r ; }
|
Turn Cookies into k = > v key - value pairs for Request
|
56,798
|
public function toResponse ( ) : array { $ r = [ ] ; foreach ( $ this -> raw as $ cookie ) { $ r [ ] = ( string ) $ cookie ; } return $ r ; }
|
Convert Cookies to a header array for Response
|
56,799
|
public function toArray ( $ simplify = false ) : array { $ r = [ ] ; foreach ( $ this as $ key => $ val ) { $ r [ $ key ] = $ val ; } if ( $ simplify ) { $ r = array_filter ( $ r ) ; } return $ r ; }
|
Convert this object to an array minimized
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.