idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
14,400
public function setAttachmentDefaults ( $ defaults ) { if ( $ this -> attachmentDefaults != ( $ defaults = ( array ) $ defaults ) ) { $ this -> attachmentDefaults = $ defaults ; $ this -> setAttachments ( $ this -> attachments ) ; } return $ this ; }
Set the attachments defaults .
14,401
protected function getAttachmentPayload ( $ text = null , $ title = null , $ images = null , $ color = null ) { $ attachment = [ ] ; if ( $ text ) { $ attachment [ 'text' ] = $ this -> stringValue ( $ text ) ; } if ( $ title ) { $ attachment [ 'title' ] = $ this -> stringValue ( $ title ) ; } if ( $ images = $ this -> ...
Get payload for an attachment .
14,402
protected function getImagesPayload ( $ value ) { $ images = [ ] ; foreach ( ( array ) $ value as $ img ) { if ( ! empty ( $ img [ 'url' ] ) ) { $ img = $ img [ 'url' ] ; } if ( is_string ( $ img ) && ! empty ( $ img ) ) { $ images [ ] = [ 'url' => $ img ] ; } } return $ images ; }
Get payload for images .
14,403
protected function stringValue ( $ value , $ jsonOptions = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES ) { if ( is_string ( $ value ) ) { return $ value ; } if ( method_exists ( $ value , '__toString' ) ) { return ( string ) $ value ; } if ( method_exists ( $ value , 'toArray' ) ) { $ value = $ value -> toArray ( )...
Convert any type to string .
14,404
public function addImage ( $ image , $ desc = null , $ title = null ) { return $ this -> addAttachment ( $ desc , $ title , $ image ) ; }
Add an image attachment to the message .
14,405
public function configureDefaults ( array $ defaults , $ force = false ) { if ( $ force || empty ( $ this -> toArray ( ) ) ) { $ attachmentDefaults = $ this -> attachmentDefaults ; foreach ( MessageDefaults :: allKeys ( ) as $ key ) { if ( isset ( $ defaults [ $ key ] ) && ! is_null ( $ value = $ defaults [ $ key ] ) )...
Configure message defaults .
14,406
protected function fillDefaults ( $ key , $ value ) { if ( ( $ key === MessageDefaults :: USER || $ key === MessageDefaults :: CHANNEL ) && ( ! is_null ( $ this -> getTarget ( ) ) ) ) { return ; } if ( $ suffix = $ this -> studlyCase ( $ key ) ) { $ getMethod = 'get' . $ suffix ; $ setMethod = 'set' . $ suffix ; if ( m...
Fill with message defaults .
14,407
public function content ( ) { $ arguments = func_get_args ( ) ; $ count = count ( $ arguments ) ; if ( $ count > 0 ) { $ this -> setText ( $ arguments [ 0 ] ) ; } if ( $ count > 1 ) { if ( is_bool ( $ arguments [ 1 ] ) ) { $ this -> setMarkdown ( $ arguments [ 1 ] ) ; if ( $ count > 2 ) { $ this -> setNotification ( $ ...
Conveniently set message content .
14,408
public function toArray ( ) { return array_filter ( [ 'text' => $ this -> getText ( ) , 'notification' => $ this -> getNotification ( ) , 'markdown' => $ this -> getMarkdown ( ) , 'channel' => $ this -> getChannel ( ) , 'user' => $ this -> getUser ( ) , 'attachments' => $ this -> getAttachments ( ) , ] , function ( $ v...
Convert the message to an array .
14,409
public function syncWithProductType ( ProductTypeContract $ productType , $ attributeIds , array $ requiredAttributes = [ ] ) { $ attributeIds = is_array ( $ attributeIds ) ? $ attributeIds : [ $ attributeIds ] ; $ pivot = [ ] ; foreach ( $ attributeIds as $ id ) { $ pivot [ $ id ] = [ 'required' => in_array ( $ id , $...
Relates attributes to a product type .
14,410
public function getData ( $ order = self :: SORT_DESC ) { return array ( 'items' => array_map ( function ( Item $ item ) { return $ item -> toArray ( ) ; } , array_values ( $ this -> getItems ( $ order ) ) ) , ) ; }
Get data in array format .
14,411
public function generate ( ) : string { $ config = '' ; foreach ( $ this -> getParams ( ) as $ key => $ value ) { $ config .= $ key . ( ( \ strlen ( $ value ) > 0 ) ? ' ' . $ value : '' ) . "\n" ; } $ certs = $ this -> getCerts ( ) ; if ( \ count ( $ certs ) > 0 ) { $ config .= "\n### Certificates\n" ; foreach ( $ this...
Generate config by parameters in memory
14,412
public function addCert ( string $ type , string $ pathOrContent , bool $ isContent = false ) : ConfigInterface { $ type = mb_strtolower ( $ type ) ; $ this -> throwIfNotInArray ( $ type , self :: CERTS ) ; if ( true === $ isContent ) { $ this -> _certs [ $ type ] [ 'content' ] = $ pathOrContent ; } else { $ this -> _c...
Add new cert into the configuration
14,413
public function delCert ( string $ type ) : ConfigInterface { $ type = mb_strtolower ( $ type ) ; $ this -> throwIfNotInArray ( $ type , self :: CERTS ) ; unset ( $ this -> _certs [ $ type ] ) ; return $ this ; }
Remove selected certificate from array
14,414
public function getCert ( string $ type ) : array { $ type = mb_strtolower ( $ type ) ; $ this -> throwIfNotInArray ( $ type , self :: CERTS ) ; return $ this -> _certs [ $ type ] ?? [ ] ; }
Return information about specified certificate
14,415
public function add ( string $ name , $ value = null ) : ConfigInterface { $ name = mb_strtolower ( $ name ) ; if ( \ in_array ( $ name , self :: CERTS , true ) ) { $ this -> addCert ( $ name , $ value ) ; } elseif ( $ name === 'push' ) { $ this -> addPush ( $ value ) ; } else { $ this -> _params [ $ name ] = $ this ->...
Add some new parameter to the list of parameters
14,416
public function del ( string $ name ) : ConfigInterface { if ( \ in_array ( $ name , self :: CERTS , true ) ) { $ this -> delCert ( $ name ) ; } elseif ( $ name === 'push' ) { throw new \ RuntimeException ( "Not possible to remove push, use 'delPush' instead" ) ; } else { $ this -> _params = array_map ( function ( $ pa...
Remove some parameter from array by name
14,417
public function getStats ( array $ options = array ( ) ) { $ resolver = new OptionsResolver ( ) ; $ resolver -> setDefaults ( array ( 'includeTextInShapes' => 'true' , ) ) -> setDefined ( array ( 'includeFootnotes' , 'includeComments' , ) ) ; $ options = $ resolver -> resolve ( $ options ) ; $ strURI = Product :: $ bas...
Get Document s stats . Add includeTextInShapes or includeFootnotes booleans to determine or these words should be added to the word count .
14,418
public function appendDocument ( $ appendDocs , $ importFormatModes , $ sourceFolder ) { if ( count ( $ appendDocs ) != count ( $ importFormatModes ) ) throw new Exception ( 'Please specify complete documents and import format modes' ) ; $ post_array = array ( ) ; $ i = 0 ; foreach ( $ appendDocs as $ doc ) { $ post_ar...
Appends a list of documents to this one .
14,419
public function unprotectDocument ( array $ options ) { $ resolver = new OptionsResolver ( ) ; $ resolver -> setRequired ( 'Password' ) -> setDefaults ( array ( 'ProtectionType' => 'AllowOnlyComments' ) ) -> setAllowedValues ( 'ProtectionType' , array ( 'AllowOnlyComments' , 'AllowOnlyFormFields' , 'AllowOnlyRevisions'...
Unprotect a document on the Aspose cloud storage .
14,420
public function updateProtection ( $ oldPassword , $ newPassword , $ protectionType = 'AllowOnlyComments' ) { if ( $ oldPassword == '' ) { throw new Exception ( 'Please Specify Old Password' ) ; } if ( $ newPassword == '' ) { throw new Exception ( 'Please Specify New Password' ) ; } $ fieldsArray = array ( 'Password' =...
Update document protection .
14,421
public function getPageSetup ( $ sectionid = '' ) { if ( $ sectionid == '' ) throw new Exception ( 'No Section Id specified' ) ; $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/sections/' . $ sectionid . '/pageSetup' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Util...
get page setup information from any section of a Word document .
14,422
public function getAllParagraphs ( ) { $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/paragraphs' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' ) ; $ json = json_decode ( $ responseStream ) ; if ( $ json -> Code == ...
get a list of all paragraphs present in a Word document .
14,423
public function getParagraph ( $ paragraphid = '' ) { if ( $ paragraphid == '' ) throw new Exception ( 'No Paragraph Id specified' ) ; $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/paragraphs/' . $ paragraphid . '' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Util...
get specefic paragraphs present in a Word document .
14,424
public function updateParagraphRunFont ( $ options_xml = '' , $ paragraphid = '' , $ runid = '' ) { if ( $ options_xml == '' ) throw new Exception ( 'Options not specified.' ) ; if ( $ paragraphid == '' ) throw new Exception ( 'No Paragraph Id specified' ) ; if ( $ runid == '' ) throw new Exception ( 'No Run Id specifi...
update font information from any run of a paragraph .
14,425
public function getHyperlinks ( ) { $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/hyperlinks' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' , '' ) ; $ json = json_decode ( $ responseStream ) ; if ( $ json -> Code =...
Get all Hyperlinks from a Word
14,426
public function getHyperlink ( $ hyperlinkIndex ) { if ( $ hyperlinkIndex == '' ) throw new Exception ( 'Hyperlink index not specified' ) ; $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/hyperlinks/' . $ hyperlinkIndex ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = U...
Get a Particular Hyperlink from a Word
14,427
public function getBookmarks ( ) { $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/bookmarks' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' , '' ) ; $ json = json_decode ( $ responseStream ) ; if ( $ json -> Code == ...
Get all Bookmarks from a Word
14,428
public function getBookmark ( $ bookmarkName ) { if ( $ bookmarkName == '' ) throw new Exception ( 'Bookmark name not specified' ) ; $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/bookmarks/' . $ bookmarkName ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: pr...
Get a Specific Bookmark from a Word
14,429
public function updateBookmark ( $ bookmarkName , $ bookmarkText ) { if ( $ bookmarkName == '' ) throw new Exception ( 'Bookmark name not specified' ) ; if ( $ bookmarkText == '' ) throw new Exception ( 'Bookmark text not specified' ) ; $ strURI = Product :: $ baseProductUri . '/words/' . $ this -> getFileName ( ) . '/...
Update Bookmark Text of a Word
14,430
public function getComments ( $ slideNo = '' , $ storageName = '' , $ folder = '' ) { if ( $ slideNo == '' ) throw new Exception ( 'Missing required parameter slideNo' ) ; $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/slides/' . $ slideNo . '/comments' ; if ( $ folder != '' ) { $ s...
Get comments from a slide .
14,431
public function getImageCount ( $ storageName = '' , $ folder = '' ) { $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/images' ; if ( $ folder != '' ) { $ strURI .= '?folder=' . $ folder ; } if ( $ storageName != '' ) { $ strURI .= '&storage=' . $ storageName ; } $ signedURI = Utils ...
Gets total number of images in a presentation .
14,432
public function getShapes ( $ slidenumber , $ storageName = '' , $ folder = '' ) { $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/slides/' . $ slidenumber . '/shapes' ; if ( $ folder != '' ) { $ strURI .= '?folder=' . $ folder ; } if ( $ storageName != '' ) { $ strURI .= '&storage='...
Gets all shapes from the specified slide .
14,433
public function getShape ( $ slideNumber , $ shapeIndex , $ storageName = '' , $ folderName = '' ) { $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/slides/' . $ slideNumber . '/shapes/' . $ shapeIndex ; if ( $ folderName != '' ) { $ strURI .= '?folder=' . $ folderName ; } if ( $ sto...
Get a Particular Shape from the Slide .
14,434
public function getColorScheme ( $ slideNumber , $ storageName = '' ) { $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/slides/' . $ slideNumber . '/theme/colorScheme' ; if ( $ storageName != '' ) { $ strURI .= '?storage=' . $ storageName ; } $ signedURI = Utils :: sign ( $ strURI ) ...
Get color scheme from the specified slide .
14,435
public function getFontScheme ( $ slideNumber , $ storageName = '' ) { $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/slides/' . $ slideNumber . '/theme/fontScheme' ; if ( $ storageName != '' ) { $ strURI .= '?storage=' . $ storageName ; } $ signedURI = Utils :: sign ( $ strURI ) ; ...
Get font scheme from the specified slide .
14,436
public function getFormatScheme ( $ slideNumber , $ storageName = '' ) { $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/slides/' . $ slideNumber . '/theme/formatScheme' ; if ( $ storageName != '' ) { $ strURI .= '?storage=' . $ storageName ; } $ signedURI = Utils :: sign ( $ strURI ...
Get format scheme from the specified slide .
14,437
public function getPlaceholderCount ( $ slideNumber , $ storageName = '' , $ folder = '' ) { $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/slides/' . $ slideNumber . '/placeholders' ; if ( $ folder != '' ) { $ strURI .= '?folder=' . $ folder ; } if ( $ storageName != '' ) { $ strUR...
Gets placeholder count from a particular slide .
14,438
public function getPlaceholder ( $ slideNumber , $ placeholderIndex , $ storageName = '' , $ folder = '' ) { $ strURI = Product :: $ baseProductUri . '/slides/' . $ this -> getFileName ( ) . '/slides/' . $ slideNumber . '/placeholders/' . $ placeholderIndex ; if ( $ folder != '' ) { $ strURI .= '?folder=' . $ folder ; ...
Gets a placeholder from a particular slide .
14,439
public function getAssignments ( ) { $ strURI = Product :: $ baseProductUri . '/tasks/' . $ this -> getFileName ( ) . '/assignments/' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' , '' ) ; $ json = json_decode ( $ responseStream ) ; if ( $ json -> Cod...
Get project assignment items . Each assignment item has a link to get full assignment representation in the project .
14,440
public function getAssignment ( $ assignmentId ) { if ( $ assignmentId == '' ) throw new Exception ( 'Assignment ID not specified' ) ; $ strURI = Product :: $ baseProductUri . '/tasks/' . $ this -> getFileName ( ) . '/assignments/' . $ assignmentId ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :...
Get project assignment .
14,441
public function addAssignment ( $ taskUid , $ resourceUid , $ units , $ changedFileName = '' ) { if ( $ taskUid == '' ) throw new Exception ( 'Task Uid not specified' ) ; if ( $ resourceUid == '' ) throw new Exception ( 'Resource Uid not specified' ) ; $ strURI = Product :: $ baseProductUri . '/tasks/' . $ this -> getF...
Adds a new assignment to a project .
14,442
public function getTasks ( ) { $ strURI = Product :: $ baseProductUri . '/tasks/' . $ this -> getFileName ( ) . '/tasks' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' , '' ) ; $ json = json_decode ( $ responseStream ) ; if ( $ json -> Code == 200 ) re...
Get project task items . Each task item has a link to get full task representation in the project .
14,443
public function getTask ( $ taskId ) { if ( $ taskId == '' ) throw new Exception ( 'Task ID not specified' ) ; $ strURI = Product :: $ baseProductUri . '/tasks/' . $ this -> getFileName ( ) . '/tasks/' . $ taskId ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GE...
Get task information .
14,444
public function addLink ( $ link , $ index , $ predecessorUid , $ successorUid , $ linkType , $ lag , $ lagFormat ) { if ( $ link == '' ) throw new Exception ( 'Link not specified' ) ; if ( $ index == '' ) throw new Exception ( 'Index not specified' ) ; if ( $ predecessorUid == '' ) throw new Exception ( 'Predecessor U...
Add a Task Link to Project
14,445
public function getOutlineCode ( $ outlineCodeId ) { if ( $ outlineCodeId == '' ) throw new Exception ( 'Outline Code ID not specified' ) ; $ strURI = Product :: $ baseProductUri . '/tasks/' . $ this -> getFileName ( ) . '/outlineCodes/' . $ outlineCodeId ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = ...
Get Outline Code
14,446
public function getExtendedAttribute ( $ extendedAttributeId ) { if ( $ extendedAttributeId == '' ) throw new Exception ( 'Extended Attribute ID not specified' ) ; $ strURI = Product :: $ baseProductUri . '/tasks/' . $ this -> getFileName ( ) . '/extendedAttributes/' . $ extendedAttributeId ; $ signedURI = Utils :: sig...
Get project extended attribute definition .
14,447
public function deleteExtendedAttribute ( $ extendedAttributeId , $ changedFileName ) { if ( $ extendedAttributeId == '' ) throw new Exception ( 'Extended Attribute ID not specified' ) ; $ strURI = Product :: $ baseProductUri . '/tasks/' . $ this -> getFileName ( ) . '/extendedAttributes/' . $ extendedAttributeId ; if ...
Delete a project extended attribute .
14,448
public static function compareTag ( ? string $ a , ? string $ b ) : int { if ( null === $ a ) { return null === $ b ? 0 : - 1 ; } return null === $ b ? 1 : strcmp ( $ a , $ b ) ; }
Compares two tags
14,449
public function updateBMPPropertiesFromLocalFile ( $ inputPath , $ bitsPerPixel , $ horizontalResolution , $ verticalResolution , $ outPath ) { if ( $ inputPath == '' ) throw new Exception ( 'Input file not specified' ) ; if ( $ bitsPerPixel == '' ) throw new Exception ( 'Color Depth not specified' ) ; if ( $ horizonta...
Update BMP Image Properties Without Storage .
14,450
public function updateGIFProperties ( $ backgroundColorIndex , $ pixelAspectRatio , $ interlaced , $ outPath ) { if ( $ backgroundColorIndex == '' ) throw new Exception ( 'Background color index not specified' ) ; if ( $ pixelAspectRatio == '' ) throw new Exception ( 'Pixel aspect ratio not specified' ) ; if ( $ outPat...
Update GIF Image Properties on Aspose cloud storage .
14,451
public function updateGIFPropertiesFromLocalFile ( $ inputPath , $ backgroundColorIndex , $ pixelAspectRatio , $ interlaced , $ outPath ) { if ( $ inputPath == '' ) throw new Exception ( 'Input file not specified' ) ; if ( $ backgroundColorIndex == '' ) throw new Exception ( 'Background color index not specified' ) ; i...
Update GIF Image Properties without storage .
14,452
public function updateJPGPropertiesFromLocalFile ( $ inputPath , $ quality , $ compressionType , $ outPath ) { if ( $ inputPath == '' ) throw new Exception ( 'Input file not specified' ) ; if ( $ quality == '' ) throw new Exception ( 'Quality not specified' ) ; if ( $ compressionType == '' ) throw new Exception ( 'Comp...
Update JPG Image Properties on Aspose cloud storage .
14,453
public function updateTIFFPropertiesFromLocalFile ( $ inputPath , $ compression , $ resolutionUnit , $ newWidth , $ newHeight , $ horizontalResolution , $ verticalResolution , $ outPath ) { if ( $ inputPath == '' ) throw new Exception ( 'Input file not specified' ) ; if ( $ compression == '' ) throw new Exception ( 'Co...
Update TIFF Image Properties Without Storage .
14,454
public function updatePSDPropertiesFromLocalFile ( $ inputPath , $ channelsCount , $ compression , $ outPath ) { if ( $ channelsCount == '' ) throw new Exception ( 'Channels count not specified' ) ; if ( $ compression == '' ) throw new Exception ( 'Compression method not specified' ) ; if ( $ outPath == '' ) throw new ...
Update PSD Image Properties without storage .
14,455
public function checkRouteAccess ( string $ routeName , $ user = null ) : bool { return $ this -> laRoute -> checkRouteAccess ( $ routeName , $ user ) ; }
Twig extension callback for checking route access
14,456
public function checkModelAccess ( $ model , string $ action , $ user = null ) : bool { return $ this -> laModel -> checkModelAccess ( $ model , $ action , $ user ) ; }
Twig extension callback for checking model access
14,457
public function checkFieldAccess ( $ model , string $ fieldName , string $ action , $ user = null ) : bool { return $ this -> laModel -> checkFieldAccess ( $ model , $ fieldName , $ action , $ user ) ; }
Twig extension callback for checking field access
14,458
public function getRulesFor ( Symbol $ subject ) : array { $ rules = [ ] ; if ( ! $ subject -> isTerminal ( ) ) { foreach ( $ this -> rules as $ rule ) { if ( 0 === Symbol :: compare ( $ rule -> getSubject ( ) , $ subject ) ) { $ rules [ ] = $ rule ; } } } return $ rules ; }
Get rules defining a subject Symbol
14,459
public function getAttachment ( $ attachmentName ) { if ( $ attachmentName == '' ) throw new Exception ( 'Attachment Name not specified' ) ; $ strURI = Product :: $ baseProductUri . '/email/' . $ this -> getFileName ( ) . '/attachments/' . $ attachmentName ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream =...
Get email attachment .
14,460
public function addItem ( $ item ) { if ( ! is_numeric ( $ item ) ) { throw new \ InvalidArgumentException ( sprintf ( "Value '%s' must be a numeric value" , $ item ) ) ; } $ this -> items [ ] = $ item ; return $ this ; }
Add an item to the item list .
14,461
public function setColour ( $ colour ) { if ( ! preg_match ( '/^[a-f0-9]{6}$/i' , $ colour ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Value %s must be a valid hex colour' , $ colour ) ) ; } $ this -> colour = $ colour ; return $ this ; }
Set the colour of the line in the widget .
14,462
public function getColour ( ) { if ( null === $ this -> colour ) { $ this -> colour = self :: DEFAULT_COLOUR ; } return $ this -> colour ; }
Return the colour of the line in the widget .
14,463
public function setAxis ( $ dimension , $ labels ) { foreach ( $ labels as $ label ) { $ this -> addLabel ( $ dimension , $ label ) ; } return $ this ; }
Set the elements to appear evenly spread along dimension .
14,464
protected function addLabel ( $ dimension , $ label ) { if ( ! in_array ( $ dimension , array ( self :: DIMENSION_X , self :: DIMENSION_Y ) ) ) { throw new \ InvalidArgumentException ( sprintf ( "Value '%s' is not a valid dimension" , $ dimension ) ) ; } $ this -> axis [ $ dimension ] [ ] = $ label ; }
Add a new label to an specific axis .
14,465
public function getAxis ( ) { if ( null === $ this -> axis ) { $ this -> axis [ self :: DIMENSION_X ] = array ( ) ; $ this -> axis [ self :: DIMENSION_Y ] = array ( ) ; } return $ this -> axis ; }
Return axises in a 2D array .
14,466
public function removeWatermark ( $ fileName ) { if ( $ fileName == '' ) throw new Exception ( 'File not specified' ) ; $ strURI = Product :: $ baseProductUri . '/words/' . $ fileName . '/watermark' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'DELETE' , '' , '...
Remove watermark from document .
14,467
public function insertWatermarkText ( $ fileName , $ text , $ rotationAngle ) { if ( $ fileName == '' ) throw new Exception ( 'File not specified' ) ; $ fieldsArray = array ( 'Text' => $ text , 'RotationAngle' => $ rotationAngle ) ; $ json = json_encode ( $ fieldsArray ) ; $ strURI = Product :: $ baseProductUri . '/wor...
Inserts water mark text into the document .
14,468
public function replaceText ( $ fileName , $ oldValue , $ newValue , $ isMatchCase , $ isMatchWholeWord ) { if ( $ fileName == '' ) throw new Exception ( 'File not specified' ) ; $ fieldsArray = array ( 'OldValue' => $ oldValue , 'NewValue' => $ newValue , 'IsMatchCase' => $ isMatchCase , 'IsMatchWholeWord' => $ isMatc...
Replace a text with the new value in the document .
14,469
public function handle ( AttributeValueRepository $ attributeValueRepository , Dispatcher $ event ) { $ attributeValue = $ attributeValueRepository -> find ( $ this -> id ) ; $ attributeValueRepository -> destroy ( $ attributeValue ) ; $ event -> fire ( new AttributeValueWasDestroyed ( $ attributeValue ) ) ; return $ a...
Handles destruction of the attribute value .
14,470
static function cleanUp ( $ string ) { if ( NORMALIZE_INTL ) { $ string = self :: replaceForNativeNormalize ( $ string ) ; $ norm = normalizer_normalize ( $ string , Normalizer :: FORM_C ) ; if ( $ norm === null || $ norm === false ) { if ( self :: quickIsNFCVerify ( $ string ) ) { return $ string ; } else { return nor...
The ultimate convenience function! Clean up invalid UTF - 8 sequences and convert to normal form C canonical composition .
14,471
static function toNFC ( $ string ) { if ( NORMALIZE_INTL ) { return normalizer_normalize ( $ string , Normalizer :: FORM_C ) ; } elseif ( self :: quickIsNFC ( $ string ) ) { return $ string ; } else { return self :: NFC ( $ string ) ; } }
Convert a UTF - 8 string to normal form C canonical composition . Fast return for pure ASCII strings ; some lesser optimizations for strings containing only known - good characters .
14,472
static function toNFD ( $ string ) { if ( NORMALIZE_INTL ) { return normalizer_normalize ( $ string , Normalizer :: FORM_D ) ; } elseif ( preg_match ( '/[\x80-\xff]/' , $ string ) ) { return self :: NFD ( $ string ) ; } else { return $ string ; } }
Convert a UTF - 8 string to normal form D canonical decomposition . Fast return for pure ASCII strings .
14,473
static function toNFKC ( $ string ) { if ( NORMALIZE_INTL ) { return normalizer_normalize ( $ string , Normalizer :: FORM_KC ) ; } elseif ( preg_match ( '/[\x80-\xff]/' , $ string ) ) { return self :: NFKC ( $ string ) ; } else { return $ string ; } }
Convert a UTF - 8 string to normal form KC compatibility composition . This may cause irreversible information loss use judiciously . Fast return for pure ASCII strings .
14,474
static function toNFKD ( $ string ) { if ( NORMALIZE_INTL ) { return normalizer_normalize ( $ string , Normalizer :: FORM_KD ) ; } elseif ( preg_match ( '/[\x80-\xff]/' , $ string ) ) { return self :: NFKD ( $ string ) ; } else { return $ string ; } }
Convert a UTF - 8 string to normal form KD compatibility decomposition . This may cause irreversible information loss use judiciously . Fast return for pure ASCII strings .
14,475
static function fastCombiningSort ( $ string ) { self :: loadData ( ) ; $ len = strlen ( $ string ) ; $ out = '' ; $ combiners = [ ] ; $ lastClass = - 1 ; for ( $ i = 0 ; $ i < $ len ; $ i ++ ) { $ c = $ string [ $ i ] ; $ n = ord ( $ c ) ; if ( $ n >= 0x80 ) { if ( $ n >= 0xf0 ) { $ c = substr ( $ string , $ i , 4 ) ;...
Sorts combining characters into canonical order . This is the final step in creating decomposed normal forms D and KD .
14,476
static function placebo ( $ string ) { $ len = strlen ( $ string ) ; $ out = '' ; for ( $ i = 0 ; $ i < $ len ; $ i ++ ) { $ out .= $ string [ $ i ] ; } return $ out ; }
This is just used for the benchmark comparing how long it takes to interate through a string without really doing anything of substance .
14,477
private static function replaceForNativeNormalize ( $ string ) { $ string = preg_replace ( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/' , Constants :: UTF8_REPLACEMENT , $ string ) ; $ string = str_replace ( Constants :: UTF8_FFFE , Constants :: UTF8_REPLACEMENT , $ string ) ; $ string = str_replace ( Constants :: UTF8_FFFF , Cons...
Function to replace some characters that we don t want but most of the native normalize functions keep .
14,478
public function seeRedirectBetween ( $ oldUrl , $ newUrl , $ statusCode ) { $ followsRedirects = $ this -> isFollowingRedirects ( ) ; $ this -> followRedirects ( false ) ; $ response = $ this -> sendHeadAndGetResponse ( $ oldUrl ) ; if ( null !== $ response ) { $ responseCode = $ response -> getStatus ( ) ; $ locationH...
Check that a redirection occurs .
14,479
public function urlDoesNotRedirect ( $ url ) { if ( '/' === $ url ) { $ url = '' ; } $ followsRedirects = $ this -> isFollowingRedirects ( ) ; $ this -> followRedirects ( false ) ; $ response = $ this -> sendHeadAndGetResponse ( $ url ) ; if ( null !== $ response ) { $ responseCode = $ response -> getStatus ( ) ; $ loc...
Check that a 200 HTTP Status is returned and the URL has no redirects .
14,480
protected function sendHeadAndGetResponse ( $ url ) { $ rest = $ this -> getModule ( 'REST' ) ; $ rest -> sendHEAD ( $ url ) ; return $ rest -> client -> getInternalResponse ( ) ; }
Use REST Module to send HEAD request and return the response .
14,481
public function setCalendarConfig ( $ arg1 , $ arg2 = null ) { if ( is_array ( $ arg1 ) ) { $ this -> calendarConfig = $ arg1 ; } else { $ this -> calendarConfig [ $ arg1 ] = $ arg2 ; } return $ this ; }
Defines either the named calendar config value or the calendar config array .
14,482
public function getCalendarConfig ( $ name = null ) { if ( ! is_null ( $ name ) ) { return isset ( $ this -> calendarConfig [ $ name ] ) ? $ this -> calendarConfig [ $ name ] : null ; } return $ this -> calendarConfig ; }
Answers either the named calendar config value or the calendar config array .
14,483
public function updateAttributes ( & $ attributes ) { $ attributes [ 'data-calendar-config' ] = $ this -> owner -> getCalendarConfigJSON ( ) ; $ attributes [ 'data-calendar-enabled' ] = $ this -> owner -> getCalendarEnabled ( ) ; }
Updates the given array of HTML attributes from the extended object .
14,484
public function getCalendarEnabled ( ) { if ( $ this -> owner -> isReadonly ( ) || $ this -> owner -> isDisabled ( ) ) { return 'false' ; } return ( $ this -> calendarDisabled || $ this -> owner -> config ( ) -> calendar_disabled ) ? 'false' : 'true' ; }
Answers true if the calendar is enabled for the extended object .
14,485
public function getImageCount ( $ pageNumber ) { $ strURI = Product :: $ baseProductUri . '/pdf/' . $ this -> getFileName ( ) . '/pages/' . $ pageNumber . '/images' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' , '' ) ; $ json = json_decode ( $ respon...
Gets number of images in a specified page .
14,486
public static function compare ( Item $ a , Item $ b ) : int { return Symbol :: compare ( $ a -> subject , $ b -> subject ) ? : Symbol :: compareList ( $ a -> passed , $ b -> passed ) ? : Symbol :: compareList ( $ a -> further , $ b -> further ) ? : ( $ b -> eof - $ a -> eof ) ; }
Compare two items
14,487
public static function createFromRule ( Rule $ rule ) : self { return new static ( $ rule -> getSubject ( ) , [ ] , $ rule -> getDefinition ( ) , $ rule -> hasEofMark ( ) , $ rule -> getTag ( ) ) ; }
Create Item from a Rule
14,488
public function shift ( ) : ? self { $ further = $ this -> further ; if ( ! $ further ) { return null ; } $ passed = $ this -> passed ; $ passed [ ] = array_shift ( $ further ) ; return new static ( $ this -> subject , $ passed , $ further , $ this -> eof , $ this -> tag ) ; }
Create new Item by shifting current position to the next symbol
14,489
public function getAsRule ( ) : Rule { return new Rule ( $ this -> subject , array_merge ( $ this -> passed , $ this -> further ) , $ this -> eof , $ this -> tag ) ; }
Reconstruct a source rule
14,490
private function getAudio ( ) { $ audioUrl = 'http://file.api.wechat.com/cgi-bin/media/get?access_token=' . $ this -> getAccessToken ( ) . '&media_id=' . $ this -> event -> get ( 'MediaId' ) ; return [ new Audio ( $ audioUrl , $ this -> event ) ] ; }
Retrieve audio url from an incoming message .
14,491
public function getFile ( $ fileName , $ storageName = '' ) { if ( $ fileName == '' ) { AsposeApp :: getLogger ( ) -> error ( Exception :: MSG_NO_FILENAME ) ; throw new Exception ( Exception :: MSG_NO_FILENAME ) ; } $ strURI = $ this -> strURIFile . $ fileName ; if ( $ storageName != '' ) { $ strURI .= '?storage=' . $ ...
Gets a file from Aspose storage .
14,492
public function copyFile ( $ fileName , $ storageName = '' , $ newDest ) { if ( $ fileName == '' || $ newDest == '' ) { AsposeApp :: getLogger ( ) -> error ( Exception :: MSG_NO_FILENAME ) ; throw new Exception ( Exception :: MSG_NO_FILENAME ) ; } $ strURI = $ this -> strURIFile . $ fileName . '?newdest=' . $ newDest ;...
Copies a file in Aspose storage to a new destination
14,493
public function findText ( ) { $ parameters = func_get_args ( ) ; if ( count ( $ parameters ) == 1 ) { $ text = $ parameters [ 0 ] ; } else if ( count ( $ parameters ) == 2 ) { $ WorkSheetName = $ parameters [ 0 ] ; $ text = $ parameters [ 1 ] ; } else { throw new Exception ( 'Invalid number of arguments' ) ; } $ strUR...
Finds a speicif text from Excel document or a worksheet .
14,494
public function getTextItems ( ) { $ parameters = func_get_args ( ) ; if ( count ( $ parameters ) > 0 ) { $ worksheetName = $ parameters [ 0 ] ; } $ strURI = Product :: $ baseProductUri . '/cells/' . $ this -> getFileName ( ) . ( ( isset ( $ parameters [ 0 ] ) ) ? '/worksheets/' . $ worksheetName . '/textItems' : '/tex...
Gets text items from the whole Excel file or a specific worksheet .
14,495
public function getMaximumInstallmentQuantity ( ) { $ product = $ this -> getProduct ( ) ? $ this -> getProduct ( ) : $ this -> getParentBlock ( ) -> getProduct ( ) ; $ maximumInstallment = $ this -> getMaximumInstallment ( $ product ) ; return $ maximumInstallment -> getMaximumInstallmentsQuantity ( ) ; }
Gets maximum installment quantity for current product
14,496
public function parse ( string $ input , $ actions = [ ] ) : TreeNodeInterface { if ( $ actions instanceof ActionsMap ) { $ actions_map = $ actions ; } elseif ( $ actions ) { $ actions_map = new ActionsMap ( $ actions ) ; } else { $ actions_map = null ; } $ stack = new Stack ( $ this -> table , $ actions_map ) ; $ pos ...
Parse input text into nodes tree
14,497
public function addChart ( $ chartType , $ upperLeftRow , $ upperLeftColumn , $ lowerRightRow , $ lowerRightColumn ) { if ( $ this -> worksheetName == '' ) throw new Exception ( 'Worksheet name not specified' ) ; $ strURI = Product :: $ baseProductUri . '/cells/' . $ this -> getFileName ( ) . '/worksheets/' . $ this ->...
Adds a new chart .
14,498
public function deleteCharts ( ) { if ( $ this -> worksheetName == '' ) throw new Exception ( 'Worksheet name not specified' ) ; $ strURI = Product :: $ baseProductUri . '/cells/' . $ this -> getFileName ( ) . '/worksheets/' . $ this -> worksheetName . '/charts/' ; $ signedURI = Utils :: sign ( $ strURI ) ; $ responseS...
Deletes all charts .
14,499
public function readChartLegend ( $ chartIndex ) { if ( $ this -> worksheetName == '' ) throw new Exception ( 'Worksheet name not specified' ) ; $ strURI = Product :: $ baseProductUri . '/cells/' . $ this -> getFileName ( ) . '/worksheets/' . $ this -> worksheetName . '/charts/' . $ chartIndex . '/legend' ; $ signedURI...
Get chart legend .