idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
1,500
protected function _getSelect ( ) { $ ret = parent :: _getSelect ( ) ; $ componentId = $ this -> _getParam ( 'componentId' ) ; $ component = Kwf_Component_Data_Root :: getInstance ( ) -> getComponentByDbId ( $ componentId , array ( 'ignoreVisible' => true ) ) ; if ( isset ( $ component -> parent -> chained ) ) { $ comp...
shows all feedbacks in all languages
1,501
public static function getResponsiveImageVars ( $ dimensions , $ imageFile ) { $ ret = array ( ) ; $ width = 0 ; $ aspectRatio = 0 ; $ ret [ 'minWidth' ] = 0 ; $ ret [ 'maxWidth' ] = 0 ; if ( isset ( $ dimensions [ 'width' ] ) && $ dimensions [ 'width' ] > 0 ) { $ aspectRatio = $ dimensions [ 'height' ] / $ dimensions ...
Helper function that calculates vars needed by components with responsive images
1,502
public function hideForValue ( Kwf_Form_Field_Abstract $ field , $ value , Kwf_Form_Field_Abstract $ hideField ) { $ this -> _hideForValue [ ] = array ( 'field' => $ field , 'value' => $ value , 'hide' => $ hideField ) ; return $ this ; }
Hide a field has a specific value hide other fields
1,503
public static function formatValidationErrors ( $ errors ) { $ msg = array ( ) ; foreach ( $ errors as $ i ) { if ( ! is_array ( $ i ) ) { throw new Kwf_Exception ( 'Form errors must be of type array' ) ; } $ name = '' ; if ( isset ( $ i [ 'field' ] ) ) { $ name = $ i [ 'field' ] -> getFieldLabel ( ) ; if ( ! $ name ) ...
Static helper function that formats form errors
1,504
public function jsonConfirmOrderAction ( ) { $ component = Kwf_Component_Data_Root :: getInstance ( ) -> getComponentById ( $ this -> _getParam ( 'paymentComponentId' ) ) ; $ order = Kwf_Model_Abstract :: getInstance ( Kwc_Abstract :: getSetting ( $ component -> chained -> getParentByClass ( 'Kwc_Shop_Cart_Component' )...
is called by js so it might be that this code isn t called at all
1,505
public function getMenuData ( $ parentData = null , $ select = array ( ) , $ editableClass = 'Kwc_Menu_EditableItems_Component' ) { return $ this -> _getMenuData ( $ parentData , $ select , $ editableClass ) ; }
Used by chained and Events
1,506
protected function _onOwnRowUpdateNotVisible ( Kwf_Component_Data $ c , Kwf_Events_Event_Row_Abstract $ event ) { parent :: _onOwnRowUpdateNotVisible ( $ c , $ event ) ; if ( $ event -> isDirty ( array ( 'kwf_upload_id' , 'width' , 'height' , 'dimension' , 'crop_x' , 'crop_y' , 'crop_width' , 'crop_height' ) ) ) { $ th...
gets called when own row gets updated weather component is visible or not
1,507
protected function _getSelect ( ) { $ select = $ this -> _model -> select ( ) ; if ( $ this -> _hasPosition ) { $ select -> order ( 'pos' ) ; } else if ( ! $ select -> hasPart ( 'order' ) && $ this -> _defaultOrder ) { $ select -> order ( $ this -> _defaultOrder [ 'field' ] , $ this -> _defaultOrder [ 'direction' ] ) ;...
override this method to handle the output of this view . Just return the select statement which serves your needs .
1,508
public static function get ( $ cacheClusterId ) { if ( ! $ cacheClusterId ) throw new Kwf_Exception ( "cacheClusterId is requried" ) ; $ ec = new Kwf_Util_Aws_ElastiCache ( ) ; $ r = $ ec -> describe_cache_clusters ( array ( 'ShowCacheNodeInfo' => true , 'CacheClusterId' => $ cacheClusterId ) ) ; if ( ! $ r -> isOk ( )...
uncached use getCached to use cache
1,509
public static function getCached ( $ cacheClusterId ) { $ cacheId = self :: _getCacheId ( $ cacheClusterId ) ; $ servers = self :: _getCache ( ) -> load ( $ cacheId ) ; if ( $ servers === false ) { $ servers = self :: refreshCache ( $ cacheClusterId ) ; } return $ servers ; }
if used you need to refresh this cache yourself
1,510
public function searchLike ( $ searchValues = array ( ) , $ searchFields = '*' ) { if ( is_string ( $ searchValues ) ) $ searchValues = array ( 'query' => $ searchValues ) ; if ( is_string ( $ searchFields ) ) $ searchFields = array ( $ searchFields ) ; foreach ( $ searchValues as $ column => $ value ) { if ( empty ( $...
Adds the needed wheres for a search
1,511
public function assemble ( ) { $ fields = $ this -> getPart ( Kwf_Db_Table_Select :: COLUMNS ) ; $ primary = $ this -> _table -> getTableName ( ) ; $ schema = $ this -> _table -> getSchemaName ( ) ; if ( count ( $ this -> _parts [ self :: UNION ] ) == 0 ) { if ( ! count ( $ fields ) ) { $ this -> from ( $ primary , sel...
Performs a validation on the select query before passing back to the parent class . Ensures that only columns from the primary Kwf_Db_Table are returned in the result .
1,512
public static function getConfigDomain ( $ host ) { if ( ! $ host ) return null ; $ longDomainEndings = array ( 'or.at' , 'co.at' , 'gv.at' , 'co.uk' ) ; foreach ( $ longDomainEndings as $ k => $ v ) { $ longDomainEndings [ $ k ] = str_replace ( '.' , '' , $ v ) ; } $ hostParts = explode ( '.' , $ host ) ; if ( count (...
for unit testing only
1,513
public static function getSettings ( ) { $ ret = parent :: getSettings ( ) ; $ ret [ 'viewCache' ] = true ; $ ret [ 'contentSender' ] = 'Kwf_Component_Abstract_ContentSender_Default' ; $ ret [ 'layoutClass' ] = 'Kwf_Component_Layout_Default' ; $ ret [ 'plugins' ] = array ( ) ; return $ ret ; }
Returns static settings of this component
1,514
public static function getIndirectChildComponentClasses ( $ class , $ select = array ( ) ) { if ( is_array ( $ select ) ) { $ select = new Kwf_Component_Select ( $ select ) ; } $ cacheId = $ select -> getHash ( ) ; $ ret = self :: _getIndirectChildComponentClasses ( $ class , $ select , $ cacheId ) ; return $ ret ; }
Returns indirect child component classes of a componentclass or a componentData
1,515
public static function getChildComponentClass ( $ class , $ generator , $ componentKey = null ) { $ constraints = array ( 'generator' => $ generator , ) ; if ( $ componentKey ) $ constraints [ 'componentKey' ] = $ componentKey ; $ classes = array_values ( self :: getChildComponentClasses ( $ class , $ constraints ) ) ;...
Returns a single child component class of a componentClass
1,516
public static function hasChildComponentClass ( $ class , $ generator , $ componentKey = null ) { $ constraints = array ( 'generator' => $ generator , 'componentKey' => $ componentKey ) ; $ classes = self :: getChildComponentClasses ( $ class , $ constraints ) ; return count ( $ classes ) > 0 ; }
Return if a child component class with a given generator key and componentKey exists
1,517
protected function _getRow ( ) { if ( ! isset ( $ this -> _row ) ) { $ model = $ this -> getOwnModel ( ) ; if ( ! $ model ) return null ; $ dbId = $ this -> getData ( ) -> dbId ; $ sharedDataClass = self :: getFlag ( $ this -> getData ( ) -> componentClass , 'sharedDataClass' ) ; if ( $ sharedDataClass ) { $ component ...
Returns the row from the ownModel of this component
1,518
public function getPdfWriter ( $ pdf ) { if ( ! isset ( $ this -> _pdfWriter ) ) { $ class = Kwc_Admin :: getComponentFile ( get_class ( $ this ) , 'Pdf' , 'php' , true ) ; $ this -> _pdfWriter = new $ class ( $ this , $ pdf ) ; } return $ this -> _pdfWriter ; }
Returns the Pdf Writer object associated with this component .
1,519
public function getTemplateVars ( Kwf_Component_Renderer_Abstract $ renderer ) { $ ret = array ( ) ; $ ret [ 'placeholder' ] = $ this -> _getPlaceholder ( ) ; $ ret [ 'rootElementClass' ] = self :: getRootElementClass ( $ this ) ; $ ret [ 'bemClass' ] = $ this -> _getBemClass ( '' ) ; $ ret [ 'data' ] = $ this -> getDa...
Returns variables that can be used in Component . tpl
1,520
public function getMasterTemplateVars ( Kwf_Component_Data $ innerComponent , Kwf_Component_Renderer_Abstract $ renderer ) { $ ret = array ( ) ; $ ret [ 'component' ] = $ innerComponent ; $ ret [ 'data' ] = $ innerComponent ; $ ret [ 'template' ] = self :: getMasterTemplateFile ( $ this -> getData ( ) -> componentClass...
Returns variables that can be used in Master . tpl
1,521
protected function _getPlaceholder ( $ placeholder = null ) { $ ret = $ this -> _getSetting ( 'placeholder' ) ; if ( $ placeholder ) { return $ this -> getData ( ) -> trlStaticExecute ( $ ret [ $ placeholder ] ) ; } foreach ( $ ret as $ k => $ v ) { $ ret [ $ k ] = $ this -> getData ( ) -> trlStaticExecute ( $ v ) ; } ...
Returns a placeholder text placeholders are set in settings
1,522
static public function getRootElementClass ( $ component ) { if ( ! is_string ( $ component ) ) $ component = $ component -> getData ( ) -> componentClass ; $ ret = '' ; if ( self :: hasSetting ( $ component , 'rootElementClass' ) ) { $ ret .= self :: getSetting ( $ component , 'rootElementClass' ) . ' ' ; } $ ret .= K...
Returns the processed rootElementClass used in various places for a component
1,523
public static function getComponentClassesByParentClass ( $ class ) { if ( ! is_array ( $ class ) ) $ class = array ( $ class ) ; static $ prefix ; $ cacheId = 'cclsbpc-' . implode ( '-' , $ class ) . '-' . Kwf_Component_Data_Root :: getComponentClass ( ) ; $ ret = Kwf_Cache_SimpleStatic :: fetch ( $ cacheId , $ succes...
Returns componentClasses that match a given class in their inheritance chain
1,524
public static function getComponentClassByParentClass ( $ class ) { $ ret = self :: getComponentClassesByParentClass ( $ class ) ; if ( count ( $ ret ) != 1 ) { if ( ! $ ret ) { throw new Kwf_Exception ( "No Component with class '$class' found" ) ; } throw new Kwf_Exception ( "More then one component with class '$class...
Returns a componentClass that match a given class in their inheritance chain
1,525
public function getActiveViewPlugins ( ) { $ ret = $ this -> _getSetting ( 'plugins' ) ; $ d = $ this -> getData ( ) ; if ( $ d -> isPage ) { while ( $ d ) { foreach ( Kwc_Abstract :: getSetting ( $ d -> componentClass , 'pluginsInherit' ) as $ i ) { if ( ! in_array ( $ i , $ ret ) ) $ ret [ ] = $ i ; } $ d = $ d -> pa...
Returns the view plugins that should be used for this component instance
1,526
public static function duplicate ( Kwf_Component_Data $ source , Kwf_Component_Data $ parentTarget , Zend_ProgressBar $ progressBar = null ) { $ new = $ source -> generator -> duplicateChild ( $ source , $ parentTarget , $ progressBar ) ; if ( ! $ new ) { throw new Kwf_Exception ( "Failed duplicating '$source->componen...
Recursively duplicate components
1,527
public function onPageChanged ( Kwf_Component_Event_Component_Abstract $ event ) { $ this -> _updates [ ] = array ( 'type' => 'componentLink' , 'component_id' => $ event -> component -> componentId ) ; $ this -> _log ( "type=componentLink component_id={$event->component->componentId}" ) ; }
namechanged and filnamechanged - events
1,528
protected function _isDirty ( $ column = null ) { if ( $ column ) { return array_key_exists ( $ column , $ this -> _cleanData ) ; } return ! empty ( $ this -> _cleanData ) ; }
Ob die Row seblst dirty ist
1,529
public final function isDirty ( $ column = null ) { if ( $ this -> _isDirty ( $ column ) ) return true ; foreach ( $ this -> _getSiblingRows ( ) as $ r ) { if ( $ r -> _isDirty ( $ column ) ) return true ; } if ( ! $ column ) { foreach ( $ this -> _childRows as $ rule => $ rows ) { foreach ( $ rows as $ row ) { if ( $ ...
Ob die Row oder eine sibling row dirty ist
1,530
public function getDirtyColumns ( ) { $ ret = array_keys ( $ this -> _cleanData ) ; foreach ( $ this -> _getSiblingRows ( ) as $ r ) { $ ret = array_merge ( $ ret , $ r -> getDirtyColumns ( ) ) ; } return $ ret ; }
dirty columns der row und der sibling rows
1,531
public function getCleanValue ( $ name ) { if ( array_key_exists ( $ name , $ this -> _cleanData ) ) { return $ this -> _cleanData [ $ name ] ; } foreach ( $ this -> _getSiblingRows ( ) as $ r ) { if ( array_key_exists ( $ name , $ r -> _cleanData ) ) { return $ r -> _cleanData [ $ name ] ; } } return $ this -> __get (...
Returns the original value of a column like it exists in the data source .
1,532
protected final function _duplicateDependentModel ( $ newRow , $ rule , $ select = array ( ) ) { $ rowset = $ this -> getChildRows ( $ rule , $ select ) ; foreach ( $ rowset as $ row ) { $ ref = $ row -> getModel ( ) -> getReferenceByModelClass ( get_class ( $ this -> getModel ( ) ) , null ) ; $ data = array ( ) ; $ da...
Hilfsfunktion die von duplicate aufgerufen werden kann
1,533
public static function sendSpammedMail ( $ id , $ key , $ tranport = null ) { $ row = Kwf_Model_Abstract :: getInstance ( 'Kwf_Model_Mail' ) -> getRow ( $ id ) ; if ( ! $ row ) return false ; if ( Kwf_Util_Check_Spam :: getSpamKey ( $ row ) != $ key ) { return false ; } if ( ! $ row -> mail_sent ) { $ row -> is_spam = ...
Public only for testing!!!
1,534
public function match ( $ request , $ partial = null ) { $ path = trim ( $ request -> getPathInfo ( ) , self :: URI_DELIMITER ) ; $ subPath = $ path ; $ values = array ( ) ; $ numRoutes = count ( $ this -> _routes ) ; $ matchedPath = null ; foreach ( $ this -> _routes as $ key => $ route ) { if ( $ key > 0 && $ matched...
zend implementation overridden to avoid pathInfo getting modified even if route didn t match
1,535
public function getRecursivePageChildIds ( $ parentId ) { $ select = new Kwf_Model_Select ( ) ; $ ret = $ this -> _getChildPageIds ( $ parentId ) ; foreach ( $ ret as $ i ) { $ ret = array_merge ( $ ret , $ this -> getRecursivePageChildIds ( $ i ) ) ; } return $ ret ; }
Returns all recursive children of a page
1,536
public function saveIncludes ( $ componentId , $ type , $ includedComponents ) { $ m = $ this -> getModel ( 'includes' ) ; $ s = $ m -> select ( ) -> whereEquals ( 'component_id' , $ componentId ) -> whereEquals ( 'type' , $ type ) ; $ existingTargetIds = array ( ) ; foreach ( $ m -> export ( Kwf_Model_Abstract :: FORM...
For unit testing - DO NOT DELETE!
1,537
protected function _loadIniFile ( $ filename ) { if ( version_compare ( PHP_VERSION , '5.3.0' ) >= 0 ) { $ loaded = parse_ini_file ( $ filename , true , INI_SCANNER_RAW ) ; $ this -> _fixValues ( $ loaded ) ; } else { $ loaded = parse_ini_file ( $ filename , true ) ; } $ iniArray = array ( ) ; foreach ( $ loaded as $ k...
im neuen zend gibts _parseIniFile - nur das sollte ?berschrieben werden
1,538
protected function _getComponentsFromRow ( $ row , $ select ) { $ idColumn = $ this -> _getGenerator ( ) -> getIdColumn ( ) ; if ( $ this -> _getGenerator ( ) -> hasSetting ( 'dbIdShortcut' ) && $ this -> _getGenerator ( ) -> getSetting ( 'dbIdShortcut' ) ) { $ dbId = $ this -> _getGenerator ( ) -> getSetting ( 'dbIdSh...
overrridden in Kwc_Root_Category_GeneratorEvents
1,539
public static function getKernel ( ) { if ( ! isset ( self :: $ _instance ) ) { if ( $ cls = Kwf_Config :: getValue ( 'symfony.kernelClass' ) ) { if ( ! class_exists ( 'Symfony\Component\HttpKernel\Kernel' ) ) return null ; self :: $ _instance = new $ cls ( ) ; self :: $ _instance -> boot ( ) ; } else { return null ; }...
Don t use this method in Symfony context
1,540
public static function getInstance ( ) { if ( is_null ( self :: $ _instance ) ) { $ c = self :: getComponentClass ( ) ; if ( $ c ) { self :: $ _instance = new self ( array ( 'componentClass' => $ c ) ) ; } else { self :: $ _instance = false ; } } return self :: $ _instance ; }
Returns the root component data instance
1,541
public function freeMemory ( ) { $ this -> _freeMemory ( ) ; foreach ( $ this -> _dataCache as $ id => $ c ) { if ( isset ( $ this -> _dataCacheIgnoreVisible [ $ id ] ) ) { unset ( $ this -> _dataCacheIgnoreVisible [ $ id ] ) ; } $ c -> _freeMemory ( ) ; } foreach ( $ this -> _dataCacheIgnoreVisible as $ id => $ c ) { ...
Tries to clear all cached data objects and row objects
1,542
public function getPageGenerators ( ) { if ( ! is_null ( $ this -> _pageGenerators ) ) return $ this -> _pageGenerators ; $ cacheId = $ this -> componentClass . '_pageGenerators' ; $ generators = Kwf_Cache_SimpleStatic :: fetch ( $ cacheId ) ; if ( ! $ generators ) { $ generators = array ( ) ; foreach ( Kwc_Abstract ::...
Returns all Kwc_Root_Category_Generators used .
1,543
public function getComponentByDbId ( $ dbId , $ select = array ( ) ) { $ components = $ this -> getComponentsByDbId ( $ dbId , $ select ) ; $ this -> _checkSingleComponent ( $ components ) ; if ( isset ( $ components [ 0 ] ) ) { return $ components [ 0 ] ; } return null ; }
Searches for a component data by it s dbId
1,544
public function getComponentsBySameClass ( $ lookingForChildClasses , $ select = array ( ) ) { $ ret = array ( ) ; if ( ! is_array ( $ lookingForChildClasses ) ) { $ lookingForChildClasses = array ( $ lookingForChildClasses ) ; } foreach ( $ lookingForChildClasses as $ c ) { if ( $ c == $ this -> componentClass ) { $ r...
Returns all components exactly matching a component class
1,545
public function indexRecursive ( Kwf_Component_Data $ page ) { if ( $ page -> isPage ) { $ r = $ this -> getRow ( $ page -> componentId ) ; if ( ! $ r ) { $ r = $ this -> createRow ( ) ; $ r -> changed_date = date ( 'Y-m-d H:i:s' ) ; } $ r -> updateFromPage ( $ page ) ; $ r -> save ( ) ; } $ childPages = $ page -> getC...
in web ComponentPagesMetaController is used
1,546
public static function getInstance ( Kwf_Component_Data $ subroot ) { while ( $ subroot ) { if ( Kwc_Abstract :: getFlag ( $ subroot -> componentClass , 'subroot' ) ) { break ; } $ subroot = $ subroot -> parent ; } if ( ! $ subroot ) $ subroot = Kwf_Component_Data_Root :: getInstance ( ) ; static $ instance = array ( )...
Returns Zend_Search_Lucene instance for given subroot
1,547
protected function _getMultiFieldsFieldset ( ) { $ fs = new Kwf_Form_Container_FieldSet ( trlKwf ( 'Paragraph {0}' ) ) ; $ fs -> add ( new Kwf_Form_Field_Checkbox ( 'visible' , trlKwf ( 'Visible' ) ) ) ; $ fs -> add ( new Kwf_Form_Field_SimpleAbstract ( 'edit' ) ) -> setXtype ( 'kwc.listeditbutton' ) -> setLabelSeparat...
MultiFields content fields .
1,548
public function getMailContent ( $ type = Kwf_Model_Mail_Row :: MAIL_CONTENT_AUTO ) { if ( $ type == Kwf_Model_Mail_Row :: MAIL_CONTENT_AUTO ) { $ ret = $ this -> _getHtmlMailContent ( ) ; if ( is_null ( $ ret ) ) $ ret = $ this -> _getTextMailContent ( ) ; return $ ret ; } else if ( $ type == Kwf_Model_Mail_Row :: MAI...
constants for type defined in Kwf_Model_Mail_Row
1,549
protected function _initSettings ( ) { parent :: _initSettings ( ) ; $ this -> _emptyIfSingleEntry = $ menuLevel = Kwc_Abstract :: getSetting ( $ this -> _class , 'emptyIfSingleEntry' ) ; }
overwritten in Kwc_Menu_Trl_Events
1,550
protected function _onMenuChanged ( Kwf_Events_Event_Abstract $ event , Kwf_Component_Data $ menu ) { parent :: _onMenuChanged ( $ event , $ menu ) ; $ newCount = count ( $ menu -> getComponent ( ) -> getMenuData ( ) ) ; if ( $ event instanceof Kwf_Component_Event_Page_Removed && $ event -> flag == Kwf_Component_Event_...
fire HasContentChanged here because hasContent is implemented in this component
1,551
private function _isAllowedComponentClass ( $ userRow , $ componentClass ) { if ( $ this -> _isAllowedComponentClassByRole ( $ this -> _getRole ( $ userRow ) , $ componentClass ) ) { return true ; } foreach ( $ this -> _getAdditionalRoles ( $ userRow ) as $ role ) { if ( $ this -> _isAllowedComponentClassByRole ( $ rol...
darum erstmal private gemacht
1,552
public function allowComponent ( $ role , $ componentClass , $ privilege = null ) { if ( $ privilege ) throw new Kwf_Exception ( "Not yet implemented" ) ; if ( ! is_null ( $ role ) ) $ role = $ this -> _roleRegistry -> get ( $ role ) ; $ rules = & $ this -> _getRules ( 'Component' , $ componentClass , $ role , true ) ;...
Allow Component plus child components on same page
1,553
protected function _fireComponentEvent ( $ eventType , Kwf_Component_Event_Component_AbstractFlag $ ev ) { $ cls = 'Kwf_Component_Event_Component_' . $ eventType ; $ g = $ this -> _getGenerator ( ) ; foreach ( $ ev -> component -> getChildComponents ( array ( 'generator' => $ g -> getGeneratorKey ( ) ) ) as $ c ) { $ t...
overridden in Page_Events_Static
1,554
public function processOutput ( $ output , $ renderer ) { $ output = parent :: processOutput ( $ output , $ renderer ) ; $ c = Kwf_Component_Data_Root :: getInstance ( ) -> getComponentById ( $ this -> _componentId ) ; $ recipient = $ c -> getComponent ( ) -> getRecipient ( ) ; $ redirectComponent = $ c -> getChildComp...
recipient is set when showing mail in browser not when sending mail
1,555
public static function parseMasterStyles ( $ masterContent ) { $ styles = array ( ) ; $ up = Kwf_Config :: getValue ( 'application.uniquePrefix' ) ; if ( $ up ) $ up .= '-' ; if ( strpos ( $ masterContent , ".{$up}webStandard" ) === false ) return $ styles ; $ up = str_replace ( '-' , '\-' , $ up ) ; preg_match_all ( "...
public fuer test
1,556
public function createFile ( $ start = null ) { if ( file_exists ( $ this -> _fileName ) ) { throw new Kwf_Exception ( "$this->_fileName already exists" ) ; } $ initialValueDates = array ( ) ; if ( is_null ( $ start ) ) { $ initialValueDates = $ this -> _getInitialValueDates ( ) ; if ( ! $ initialValueDates ) { $ start...
erstellt rrd Datei
1,557
public function createSale ( Sale $ sale ) { $ createSaleRequest = new CreateSaleRequest ( $ this -> merchant , $ this -> environment ) ; return $ createSaleRequest -> execute ( $ sale ) ; }
Send the Sale to be created and return the Sale with tid and the status returned by Cielo .
1,558
public function getSale ( $ paymentId ) { $ querySaleRequest = new QuerySaleRequest ( $ this -> merchant , $ this -> environment ) ; return $ querySaleRequest -> execute ( $ paymentId ) ; }
Query a Sale on Cielo by paymentId
1,559
public function getRecurrentPayment ( $ recurrentPaymentId ) { $ queryRecurrentPaymentRequest = new queryRecurrentPaymentRequest ( $ this -> merchant , $ this -> environment ) ; return $ queryRecurrentPaymentRequest -> execute ( $ recurrentPaymentId ) ; }
Query a RecurrentPayment on Cielo by RecurrentPaymentId
1,560
public function cancelSale ( $ paymentId , $ amount = null ) { $ updateSaleRequest = new UpdateSaleRequest ( 'void' , $ this -> merchant , $ this -> environment ) ; $ updateSaleRequest -> setAmount ( $ amount ) ; return $ updateSaleRequest -> execute ( $ paymentId ) ; }
Cancel a Sale on Cielo by paymentId and speficying the amount
1,561
public function captureSale ( $ paymentId , $ amount = null , $ serviceTaxAmount = null ) { $ updateSaleRequest = new UpdateSaleRequest ( 'capture' , $ this -> merchant , $ this -> environment ) ; $ updateSaleRequest -> setAmount ( $ amount ) ; $ updateSaleRequest -> setServiceTaxAmount ( $ serviceTaxAmount ) ; return ...
Capture a Sale on Cielo by paymentId and specifying the amount and the serviceTaxAmount
1,562
public static function getIncludes ( $ func ) { $ loader = new static ( ) ; call_user_func ( $ func , $ loader ) ; $ loader -> unregister ( ) ; $ config = new Config ( ) ; foreach ( $ loader -> getFilenames ( ) as $ file ) { $ config -> addFile ( $ file ) ; } return $ config ; }
Wrap a block of code in the autoloader and get a list of loaded classes .
1,563
public function loadClass ( $ class ) { foreach ( spl_autoload_functions ( ) as $ func ) { if ( is_array ( $ func ) && $ func [ 0 ] === $ this ) { continue ; } $ this -> classList -> push ( $ class ) ; if ( call_user_func ( $ func , $ class ) ) { break ; } } $ this -> classList -> next ( ) ; return true ; }
Loads the given class interface or trait .
1,564
public function getFilenames ( ) { $ files = [ ] ; foreach ( $ this -> classList -> getClasses ( ) as $ class ) { try { $ r = new \ ReflectionClass ( $ class ) ; foreach ( $ r -> getInterfaces ( ) as $ inf ) { $ name = $ inf -> getFileName ( ) ; if ( $ name && ! in_array ( $ name , $ files ) ) { $ files [ ] = $ name ; ...
Get an array of loaded file names in order of loading .
1,565
public function getFilenames ( ) { $ filenames = [ ] ; foreach ( $ this -> filenames as $ f ) { foreach ( $ this -> inclusiveFilters as $ filter ) { if ( ! preg_match ( $ filter , $ f ) ) { continue 2 ; } } foreach ( $ this -> exclusiveFilters as $ filter ) { if ( preg_match ( $ filter , $ f ) ) { continue 2 ; } } $ fi...
Get an array of file names that satisfy any added filters .
1,566
public function traverseFile ( array $ nodes , $ filename ) { foreach ( $ this -> visitors as $ visitor ) { if ( $ visitor instanceof AbstractNodeVisitor ) { $ visitor -> setFilename ( $ filename ) ; } } return $ this -> traverse ( $ nodes ) ; }
Transverse the file .
1,567
public function next ( ) { if ( isset ( $ this -> current -> next ) ) { $ this -> current = $ this -> current -> next ; } else { $ this -> current -> next = new ClassNode ( null , $ this -> current ) ; $ this -> current = $ this -> current -> next ; } }
Traverse to the next node in the list .
1,568
public function push ( $ value ) { if ( ! $ this -> current -> value ) { $ this -> current -> value = $ value ; } else { $ temp = $ this -> current ; $ this -> current = new ClassNode ( $ value , $ temp -> prev ) ; $ this -> current -> next = $ temp ; $ temp -> prev = $ this -> current ; if ( $ temp === $ this -> head ...
Insert a value at the current position in the list .
1,569
public function getClasses ( ) { $ classes = [ ] ; $ current = $ this -> head ; while ( $ current && $ current -> value ) { $ classes [ ] = $ current -> value ; $ current = $ current -> next ; } return array_filter ( $ classes ) ; }
Traverse the ClassList and return a list of classes .
1,570
public function create ( array $ options = [ ] ) { $ printer = new PrettyPrinter ( ) ; $ parser = $ this -> getParser ( ) ; $ options = array_merge ( [ 'dir' => true , 'file' => true , 'skip' => false , 'strict' => false ] , $ options ) ; $ traverser = $ this -> getTraverser ( $ options [ 'dir' ] , $ options [ 'file' ]...
Create a new class preloader instance .
1,571
protected function getTraverser ( $ dir , $ file , $ skip , $ strict ) { $ traverser = new NodeTraverser ( ) ; if ( $ dir ) { $ traverser -> addVisitor ( new DirVisitor ( $ skip ) ) ; } if ( $ file ) { $ traverser -> addVisitor ( new FileVisitor ( $ skip ) ) ; } if ( ! $ strict ) { $ traverser -> addVisitor ( new Stric...
Get the node traverser to use .
1,572
public function prepareOutput ( $ output , $ strict = false ) { if ( $ strict && version_compare ( PHP_VERSION , '7' ) < 1 ) { throw new RuntimeException ( 'Strict mode requires PHP 7 or greater.' ) ; } $ dir = dirname ( $ output ) ; if ( ! is_dir ( $ dir ) && ! mkdir ( $ dir , 0777 , true ) ) { throw new RuntimeExcept...
Prepare the output file and directory .
1,573
public function getCode ( $ file , $ comments = true ) { if ( ! is_string ( $ file ) || empty ( $ file ) ) { throw new RuntimeException ( 'Invalid filename provided.' ) ; } if ( ! is_readable ( $ file ) ) { throw new RuntimeException ( "Cannot open $file for reading." ) ; } if ( $ comments ) { $ content = file_get_cont...
Get a pretty printed string of code from a file while applying visitors .
1,574
protected function getCodeWrappedIntoNamespace ( array $ parsed , $ pretty ) { if ( $ this -> parsedCodeHasNamespaces ( $ parsed ) ) { $ pretty = preg_replace ( '/^\s*(namespace.*);/im' , '${1} {' , $ pretty , 1 ) . "\n}\n" ; } else { $ pretty = sprintf ( "namespace {\n%s\n}\n" , $ pretty ) ; } return preg_replace ( '/...
Wrap the code into a namespace .
1,575
protected function parsedCodeHasNamespaces ( array $ parsed ) { $ node = array_filter ( $ parsed , function ( $ value ) { return $ value instanceof NamespaceNode ; } ) ; return ! empty ( $ node ) ; }
Check parsed code for having namespaces .
1,576
public function pipe ( $ callback , ... $ arguments ) { if ( ! is_callable ( $ callback ) ) { return new PipeProxy ( $ this , $ callback ) ; } $ this -> value = $ callback ( ... $ this -> addValueToArguments ( $ arguments ) ) ; return $ this ; }
Perform an operation on the current value .
1,577
public function addValueToArguments ( array $ arguments ) : array { if ( ! in_array ( PIPED_VALUE , $ arguments , true ) ) { return array_merge ( [ $ this -> value ] , $ arguments ) ; } return array_map ( function ( $ argument ) { return $ argument === PIPED_VALUE ? $ this -> value : $ argument ; } , $ arguments ) ; }
Add the given value to the list of arguments .
1,578
public function createRequest ( $ url , $ method = 'GET' , array $ headers = [ ] , $ body = null ) { $ headers = array_merge ( $ headers , [ 'User-Agent' => strval ( $ this -> userAgent ) ] ) ; return new Request ( $ method , $ url , $ headers , $ body ) ; }
Creates a request object .
1,579
public static function create ( $ merchantId , $ sharedSecret , $ baseUrl = self :: EU_BASE_URL , UserAgentInterface $ userAgent = null ) { $ client = new Client ( [ 'base_uri' => $ baseUrl ] ) ; return new static ( $ client , $ merchantId , $ sharedSecret , $ userAgent ) ; }
Factory method to create a connector instance .
1,580
public function getCSVPayoutsSummaryReport ( array $ params = [ ] ) { return $ this -> get ( self :: $ path . '/payouts-summary-with-transactions?' . http_build_query ( $ params ) ) -> status ( '200' ) -> contentType ( 'text/csv' ) -> getBody ( ) ; }
Returns CSV summary .
1,581
public function generateToken ( array $ data ) { $ response = $ this -> post ( $ this -> getLocation ( ) . '/customer-token' , $ data ) -> status ( '200' ) -> contentType ( 'application/json' ) -> getJson ( ) ; return $ response ; }
Generates consumer token .
1,582
public function createOrder ( array $ data , $ klarnaIdempotencyKey = null ) { $ headers = [ 'Content-Type' => 'application/json' ] ; if ( ! is_null ( $ klarnaIdempotencyKey ) ) { $ headers [ 'Klarna-Idempotency-Key' ] = $ klarnaIdempotencyKey ; } return $ this -> request ( 'POST' , $ this -> getLocation ( ) . '/order'...
Creates order using Customer Token .
1,583
public function fetch ( ) { parent :: fetch ( ) ; $ captures = [ ] ; foreach ( $ this [ 'captures' ] as $ capture ) { $ captureId = $ capture [ Capture :: ID_FIELD ] ; $ object = new Capture ( $ this -> connector , $ this -> getLocation ( ) , $ captureId ) ; $ object -> exchangeArray ( $ capture ) ; $ captures [ ] = $ ...
Fetches the order .
1,584
public function refund ( array $ data ) { $ refund = new Refund ( $ this -> connector , $ this -> getLocation ( ) ) ; $ refund -> create ( $ data ) ; return $ refund ; }
Refunds an amount of a captured order .
1,585
public function createCapture ( array $ data ) { $ capture = new Capture ( $ this -> connector , $ this -> getLocation ( ) ) ; $ capture -> create ( $ data ) ; $ this [ 'captures' ] [ ] = $ capture ; return $ capture ; }
Capture all or part of an order .
1,586
public function fetchCapture ( $ captureId ) { if ( $ this -> offsetExists ( 'captures' ) ) { foreach ( $ this [ 'captures' ] as $ capture ) { if ( $ capture -> getId ( ) !== $ captureId ) { continue ; } return $ capture -> fetch ( ) ; } } $ capture = new Capture ( $ this -> connector , $ this -> getLocation ( ) , $ ca...
Fetches the specified capture .
1,587
public function fetchRefund ( $ refundId ) { if ( $ this -> offsetExists ( 'refunds' ) ) { foreach ( $ this [ 'refunds' ] as $ refund ) { if ( $ refund -> getId ( ) !== $ refundId ) { continue ; } return $ refund ; } } $ refund = new Refund ( $ this -> connector , $ this -> getLocation ( ) , $ refundId ) ; $ refund -> ...
Fetches the specified refund .
1,588
public function fetchCaptures ( ) { $ captures = new Capture ( $ this -> connector , $ this -> getLocation ( ) ) ; $ captures = $ captures -> fetch ( ) -> getArrayCopy ( ) ; foreach ( $ captures as $ id => $ capture ) { $ captures [ $ id ] = new Capture ( $ this -> connector , $ this -> getLocation ( ) , $ capture [ 'c...
Fetches all captures .
1,589
public function create ( array $ data ) { $ response = $ this -> post ( self :: $ path , $ data ) -> status ( '201' ) -> contentType ( 'application/json' ) -> getJson ( ) ; return $ response ; }
Creates a new settlement .
1,590
public function retrieveSettlement ( $ settlementId , $ keyId ) { $ response = $ this -> request ( 'GET' , self :: $ path . "/$settlementId" , [ 'KeyId' => $ keyId ] ) -> status ( '200' ) -> contentType ( 'application/json' ) -> getJson ( ) ; return $ response ; }
Retrieve an existing settlement .
1,591
public function retrieveOrderSettlement ( $ orderId , $ keyId ) { $ response = $ this -> request ( 'GET' , self :: $ path . "/order/$orderId" , [ 'KeyId' => $ keyId ] ) -> status ( '200' ) -> contentType ( 'application/json' ) -> getJson ( ) ; return $ response ; }
Retrieves a settled order s settlement .
1,592
public function setField ( $ key , $ name , $ version = '' , array $ options = [ ] ) { $ field = [ 'name' => $ name ] ; if ( ! empty ( $ version ) ) { $ field [ 'version' ] = $ version ; } if ( ! empty ( $ options ) ) { $ field [ 'options' ] = $ options ; } $ this -> fields [ $ key ] = $ field ; return $ this ; }
Sets the specified field .
1,593
public static function createDefault ( ) { $ agent = new static ( ) ; $ options = [ 'Guzzle/' . ClientInterface :: VERSION ] ; if ( extension_loaded ( 'curl' ) ) { $ options [ ] = 'curl/' . curl_version ( ) [ 'version' ] ; } return $ agent -> setField ( 'Library' , static :: NAME , static :: VERSION , $ options ) -> se...
Creates the default user agent .
1,594
public function disable ( ) { if ( empty ( $ this [ static :: ID_FIELD ] ) ) { throw new \ RuntimeException ( 'HPP Session ID is not defined' ) ; } $ this -> delete ( $ this -> getLocation ( ) ) -> status ( '204' ) ; return $ this ; }
Disables HPP session .
1,595
public function update ( array $ data ) { if ( empty ( $ this [ static :: ID_FIELD ] ) ) { throw new \ RuntimeException ( static :: ID_FIELD . ' property is not defined' ) ; } return $ this -> put ( $ this -> getLocation ( ) , $ data ) -> status ( '200' ) -> contentType ( 'application/json' ) -> getJson ( ) ; }
Updates the setup options for a specific button key .
1,596
public function decline ( array $ data = null ) { $ this -> delete ( $ this -> getLocation ( ) , $ data ) -> status ( '204' ) ; return $ this ; }
Declines an authorized order identified by the authorization token .
1,597
public function getAllPayouts ( array $ params = [ ] ) { return $ this -> get ( self :: $ path . '?' . http_build_query ( $ params ) ) -> status ( '200' ) -> contentType ( 'application/json' ) -> getJson ( ) ; }
Returns a collection of payouts .
1,598
public function fetch ( ) { $ data = $ this -> get ( $ this -> getLocation ( ) ) -> status ( '200' ) -> contentType ( 'application/json' ) -> getJson ( ) ; $ this -> exchangeArray ( $ data ) ; return $ this ; }
Fetches the resource .
1,599
protected function request ( $ method , $ url , array $ headers = [ ] , $ body = '' ) { $ debug = getenv ( 'DEBUG_SDK' ) || defined ( 'DEBUG_SDK' ) ; $ request = $ this -> connector -> createRequest ( $ url , $ method , $ headers , $ body ) ; if ( $ debug ) { $ clientConfig = $ this -> connector -> getClient ( ) -> get...
Sends a HTTP request to the specified url .