idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
226,800 | public function createCommand ( $ db = null ) { $ modelClass = $ this -> modelClass ; if ( $ db === null ) { $ db = $ modelClass :: getDb ( ) ; } if ( $ this -> sql === null ) { list ( $ sql , $ params ) = $ db -> getQueryBuilder ( ) -> build ( $ this ) ; } else { $ sql = $ this -> sql ; $ params = $ this -> params ; }... | Generate DB command from ActiveQuery with Maria - specific SQL for dynamic columns . |
226,801 | protected function getDotNotatedValue ( $ array , $ attribute ) { $ pieces = explode ( '.' , $ attribute ) ; foreach ( $ pieces as $ piece ) { if ( ! is_array ( $ array ) || ! array_key_exists ( $ piece , $ array ) ) { return null ; } $ array = $ array [ $ piece ] ; } return $ array ; } | Returns the value of the element in an array refereced by a dot - notated attribute name . |
226,802 | public function getAttribute ( $ name ) { try { return parent :: __get ( $ name ) ; } catch ( UnknownPropertyException $ ignore ) { } $ path = explode ( '.' , $ name ) ; $ ref = & $ this -> _dynamicAttributes ; foreach ( $ path as $ key ) { if ( ! isset ( $ ref [ $ key ] ) ) { return null ; } $ ref = & $ ref [ $ key ] ... | Returns a model attribute value . |
226,803 | public function setAttribute ( $ name , $ value ) { try { parent :: __set ( $ name , $ value ) ; return ; } catch ( UnknownPropertyException $ ignore ) { } $ path = explode ( '.' , $ name ) ; $ ref = & $ this -> _dynamicAttributes ; do { $ key = $ path [ 0 ] ; if ( isset ( $ ref [ $ key ] ) ) { $ ref = & $ ref [ $ key ... | Sets a model attribute . |
226,804 | public function issetAttribute ( $ name ) { try { if ( parent :: __get ( $ name ) !== null ) { return true ; } } catch ( Exception $ ignore ) { } $ path = explode ( '.' , $ name ) ; $ ref = & $ this -> _dynamicAttributes ; foreach ( $ path as $ key ) { if ( ! isset ( $ ref [ $ key ] ) ) { return false ; } $ ref = & $ r... | Returns if a model attribute is set . |
226,805 | public function unsetAttribute ( $ name ) { try { parent :: __unset ( $ name ) ; } catch ( \ Exception $ ignore ) { } if ( $ this -> issetAttribute ( $ name ) ) { $ this -> setAttribute ( $ name , null ) ; } } | Unset a model attribute . |
226,806 | protected static function dotKeyValues ( $ prefix , $ array ) { $ fields = [ ] ; foreach ( $ array as $ key => $ value ) { if ( is_string ( $ key ) ) { $ newPos = $ prefix . '.' . $ key ; if ( is_array ( $ value ) ) { $ fields = array_merge ( $ fields , static :: dotKeyValues ( $ newPos , $ value ) ) ; } else { $ field... | Convert a nested array to a map of dot - notation keys to values . |
226,807 | public function dotAttributeNames ( ) { return array_merge ( array_values ( parent :: fields ( ) ) , array_keys ( static :: dotKeyValues ( static :: dynamicColumn ( ) , $ this -> _dynamicAttributes ) ) ) ; } | Return a list of all model attribute names recursing structured dynamic attributes . |
226,808 | public static function columnExpression ( $ name , $ type = 'char' ) { $ sql = '[[' . static :: dynamicColumn ( ) . ']]' ; $ parts = explode ( '.' , $ name ) ; $ lastPart = array_pop ( $ parts ) ; foreach ( $ parts as $ column ) { $ sql = "COLUMN_GET($sql, '$column' AS BINARY)" ; } $ sql = "COLUMN_GET($sql, '$lastPart'... | Generate an SQL expression referring to the given dynamic column . |
226,809 | public static function encodeForMaria ( $ value ) { return is_string ( $ value ) && ( ! mb_check_encoding ( $ value , 'UTF-8' ) || strpos ( $ value , self :: DATA_URI_PREFIX ) === 0 ) ? self :: DATA_URI_PREFIX . base64_encode ( $ value ) : $ value ; } | Encode as data URIs strings that JSON cannot express . |
226,810 | public static function decodeForMaria ( $ value ) { return is_string ( $ value ) && strpos ( $ value , self :: DATA_URI_PREFIX ) === 0 ? file_get_contents ( $ value ) : $ value ; } | Decode strings encoded as data URIs . |
226,811 | protected static function walk ( & $ array , $ method ) { if ( is_scalar ( $ array ) ) { $ array = static :: $ method ( $ array ) ; return ; } $ replacements = [ ] ; foreach ( $ array as $ key => & $ value ) { if ( is_scalar ( $ value ) || $ value === null ) { $ value = static :: $ method ( $ value ) ; } else { static ... | Replacement for PHP s array walk and map builtins . |
226,812 | protected static function dynColSqlMaria ( array $ attrs , & $ params ) { $ sql = [ ] ; foreach ( $ attrs as $ key => $ value ) { if ( is_object ( $ value ) && ! ( $ value instanceof ValueExpression ) ) { $ value = method_exists ( $ value , 'toArray' ) ? $ value -> toArray ( ) : ( array ) $ value ; } if ( $ value === [... | Creates the SQL and parameter bindings for setting dynamic attributes in a DB record as Dynamic Columns in Maria . |
226,813 | public static function dynColExpression ( $ attrs ) { if ( ! $ attrs ) { return null ; } $ params = [ ] ; static :: encodeArrayForMaria ( $ attrs ) ; $ sql = static :: dynColSqlMaria ( $ attrs , $ params ) ; return new \ yii \ db \ Expression ( $ sql , $ params ) ; } | Creates a dynamic column SQL expression representing the given attributes . |
226,814 | public static function dynColDecode ( $ encoded ) { $ encoded = preg_replace_callback ( '/[\x00-\x1f]/' , function ( $ matches ) { return sprintf ( '\u00%02x' , ord ( $ matches [ 0 ] ) ) ; } , $ encoded ) ; $ decoded = json_decode ( $ encoded , true ) ; if ( $ decoded ) { static :: decodeArrayForMaria ( $ decoded ) ; }... | Decode a serialized blob of dynamic attributes . |
226,815 | public function beforeControllerAction ( $ controller , $ action ) { if ( parent :: beforeControllerAction ( $ controller , $ action ) ) { $ user = Yii :: app ( ) -> getUser ( ) ; if ( $ user instanceof AuthWebUser ) { if ( $ user -> isAdmin ) { return true ; } elseif ( $ user -> isGuest ) { $ user -> loginRequired ( )... | The pre - filter for controller actions . |
226,816 | public function getInputType ( ) { switch ( true ) { case $ this -> callback instanceof Closure : return self :: CLOSURE_TYPE ; case is_callable ( $ this -> callback , false ) : return self :: CALLABLE_TYPE ; case is_string ( $ this -> callback ) : return self :: SELF_METHOD_TYPE ; } throw new InvalidCallbackException ... | Figures out which type of input was provided |
226,817 | public function applyFilterRules ( $ property , $ filterRules = array ( ) ) { foreach ( $ filterRules as $ rule ) { $ this -> applyFilterRule ( $ property , $ rule ) ; } } | Applies the selected rules to a property in the object |
226,818 | private function setPropertyValue ( $ propertyName , $ value ) { $ this -> getAccessibleReflectionProperty ( $ propertyName ) -> setValue ( $ this -> object , $ value ) ; } | Overrides the value of a property overcoming visibility problems |
226,819 | private function getAccessibleReflectionProperty ( $ propertyName ) { $ property = $ this -> reflClass -> getProperty ( $ propertyName ) ; $ property -> setAccessible ( true ) ; return $ property ; } | Retrieves a property from the object and makes it visible |
226,820 | public function init ( ) { parent :: init ( ) ; $ this -> layout = $ this -> module -> defaultLayout ; $ this -> menu = $ this -> getSubMenu ( ) ; } | Initializes the controller . |
226,821 | public function getItemTypeText ( $ type , $ plural = false ) { $ n = $ plural ? 2 : 1 ; switch ( $ type ) { case CAuthItem :: TYPE_OPERATION : $ name = Yii :: t ( 'AuthModule.main' , 'operation|operations' , $ n ) ; break ; case CAuthItem :: TYPE_TASK : $ name = Yii :: t ( 'AuthModule.main' , 'task|tasks' , $ n ) ; br... | Returns the authorization item type as a string . |
226,822 | public function getItemControllerId ( $ type ) { $ controllerId = null ; switch ( $ type ) { case CAuthItem :: TYPE_OPERATION : $ controllerId = 'operation' ; break ; case CAuthItem :: TYPE_TASK : $ controllerId = 'task' ; break ; case CAuthItem :: TYPE_ROLE : $ controllerId = 'role' ; break ; default : throw new CExce... | Returns the controllerId for the given authorization item . |
226,823 | public function capitalize ( $ string ) { if ( ! extension_loaded ( 'mbstring' ) ) { return ucfirst ( $ string ) ; } $ encoding = Yii :: app ( ) -> charset ; $ firstChar = mb_strtoupper ( mb_substr ( $ string , 0 , 1 , $ encoding ) , $ encoding ) ; return $ firstChar . mb_substr ( $ string , 1 , mb_strlen ( $ string , ... | Capitalizes the first word in the given string . |
226,824 | protected function getSubMenu ( ) { return array ( array ( 'label' => Yii :: t ( 'AuthModule.main' , 'Assignments' ) , 'url' => array ( '/auth/assignment/index' ) , 'active' => $ this instanceof AssignmentController , ) , array ( 'label' => $ this -> capitalize ( $ this -> getItemTypeText ( CAuthItem :: TYPE_ROLE , tru... | Returns the sub menu configuration . |
226,825 | protected function setDefaults ( ) { parent :: setDefaults ( ) ; $ this -> setReferenceNumberLeftAttr ( 3 , 60 , 50 , 4 , null , null , 8 ) ; $ this -> setReferenceNumberRightAttr ( 125 , 33.5 , 80 , 4 ) ; $ this -> setCodeLineAttr ( 64 , 85 , 140 , 4 , null , 'OCRB10' ) ; $ this -> setSlipBackground ( __DIR__ . '/Reso... | Sets the default attributes of the elements for an orange slip |
226,826 | public function setReferenceNumberLeftAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> referenceNumberLeftAttr , $ posX , $ posY ... | Set the left reference number attributes |
226,827 | public function setReferenceNumberRightAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { if ( $ textAlign === null ) { $ textAlign = 'R' ; } $ this -> setAttributes (... | Set the right reference number attributes |
226,828 | public function setCodeLineAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { if ( $ textAlign === null ) { $ textAlign = 'R' ; } $ this -> setAttributes ( $ this -> c... | Set the code line attributes |
226,829 | public function setDisplayReferenceNr ( $ displayReferenceNr = true ) { $ this -> isBool ( $ displayReferenceNr , 'displayReferenceNr' ) ; $ this -> displayReferenceNr = $ displayReferenceNr ; return $ this ; } | Set whether or not to display the reference number |
226,830 | public function setDisplayCodeLine ( $ displayCodeLine = true ) { $ this -> isBool ( $ displayCodeLine , 'displayCodeLine' ) ; $ this -> displayCodeLine = $ displayCodeLine ; return $ this ; } | Set whether or not to display the code line at the bottom |
226,831 | public function getDisplayCodeLine ( ) { if ( $ this -> getPaymentSlipData ( ) -> getWithAccountNumber ( ) !== true || $ this -> getPaymentSlipData ( ) -> getWithReferenceNumber ( ) !== true ) { return false ; } return $ this -> displayCodeLine ; } | Get whether or not to display the code line at the bottom |
226,832 | public function getFilterForRule ( Rule $ rule ) { $ filterIdentifier = $ rule -> getFilter ( ) ; if ( class_exists ( $ filterIdentifier ) ) { return new $ filterIdentifier ; } $ error = "Unable to locate filter for: $filterIdentifier defined in " . get_class ( $ rule ) ; throw new \ UnexpectedValueException ( $ error ... | Finds the filter responsible for executing a specific rule |
226,833 | public function actionView ( $ id ) { $ formModel = new AddAuthItemForm ( ) ; $ am = Yii :: app ( ) -> getAuthManager ( ) ; if ( isset ( $ _POST [ 'AddAuthItemForm' ] ) ) { $ formModel -> attributes = $ _POST [ 'AddAuthItemForm' ] ; if ( $ formModel -> validate ( ) ) { if ( ! $ am -> isAssigned ( $ formModel -> items ,... | Displays the assignments for the user with the given id . |
226,834 | public function actionRevoke ( ) { if ( isset ( $ _GET [ 'itemName' ] , $ _GET [ 'userId' ] ) ) { $ itemName = $ _GET [ 'itemName' ] ; $ userId = $ _GET [ 'userId' ] ; $ am = Yii :: app ( ) -> getAuthManager ( ) ; if ( $ am -> isAssigned ( $ itemName , $ userId ) ) { $ am -> revoke ( $ itemName , $ userId ) ; if ( $ am... | Revokes an assignment from the given user . |
226,835 | protected function getAssignmentOptions ( $ userId ) { $ options = array ( ) ; $ am = Yii :: app ( ) -> authManager ; $ assignments = $ am -> getAuthAssignments ( $ userId ) ; $ assignedItems = array_keys ( $ assignments ) ; $ authItems = $ am -> getAuthItems ( ) ; foreach ( $ authItems as $ itemName => $ item ) { if (... | Returns a list of possible assignments for the user with the given id . |
226,836 | private function parseOptions ( $ options ) { $ parseResult = new \ stdClass ( ) ; $ parseResult -> invalidOptions = array ( ) ; $ parseResult -> missingOptions = array_flip ( ( array ) $ this -> getRequiredOptions ( ) ) ; if ( is_array ( $ options ) && count ( $ options ) == 1 && isset ( $ options [ 'value' ] ) ) { $ ... | Parses provided options into their properties and returns results for the parsing process |
226,837 | private function parseOptionsArray ( $ options , \ stdClass $ result ) { foreach ( $ options as $ option => $ value ) { if ( ! property_exists ( $ this , $ option ) ) { $ result -> invalidOptions [ ] = $ option ; continue ; } $ this -> $ option = $ value ; unset ( $ result -> missingOptions [ $ option ] ) ; } } | Parses Options in the array format |
226,838 | private function parseSingleOption ( $ options , \ stdClass $ result ) { $ option = $ this -> getDefaultOption ( ) ; if ( null === $ option ) { throw new RuleDefinitionException ( sprintf ( 'No default option is configured for rule %s' , get_class ( $ this ) ) ) ; } if ( ! property_exists ( $ this , $ option ) ) { $ re... | Parses single option received |
226,839 | public function getZendInstance ( $ class , $ options ) { if ( strpos ( $ class , 'Zend\Filter' ) === false ) { $ class = "Zend\Filter\\" . $ class ; } if ( ! class_exists ( $ class ) ) { throw new InvalidZendFilterException ( "Could not find or autoload: $class" ) ; } try { new \ ReflectionMethod ( $ class , 'setOptio... | Instantiates a configured Zend Filter if it exists |
226,840 | protected function setDefaults ( ) { $ this -> setBankLeftAttr ( 3 , 8 , 50 , 4 ) ; $ this -> setBankRightAttr ( 66 , 8 , 50 , 4 ) ; $ this -> setRecipientLeftAttr ( 3 , 23 , 50 , 4 ) ; $ this -> setRecipientRightAttr ( 66 , 23 , 50 , 4 ) ; $ this -> setAccountLeftAttr ( 27 , 43 , 30 , 4 ) ; $ this -> setAccountRightAt... | Sets the common default attributes of the elements |
226,841 | public function setSlipPosition ( $ slipPosX , $ slipPosY ) { $ this -> setSlipPosX ( $ slipPosX ) ; $ this -> setSlipPosY ( $ slipPosY ) ; return $ this ; } | Set the starting X & Y position of the slip |
226,842 | public function setSlipSize ( $ slipWidth , $ slipHeight ) { $ this -> setSlipHeight ( $ slipHeight ) ; $ this -> setSlipWidth ( $ slipWidth ) ; return $ this ; } | Set the height & width of the slip |
226,843 | protected function setAttributes ( & $ element , $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { if ( $ posX ) { $ element [ 'PosX' ] = $ posX ; } elseif ( ! isset ( $ ele... | Set the attributes for a given payment slip element |
226,844 | public function setBankLeftAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> bankLeftAttr , $ posX , $ posY , $ width , $ height ,... | Set the left bank attributes |
226,845 | public function setBankRightAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> bankRightAttr , $ posX , $ posY , $ width , $ height... | Set the right bank attributes |
226,846 | public function setRecipientLeftAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> recipientLeftAttr , $ posX , $ posY , $ width , ... | Set the left recipient attributes |
226,847 | public function setRecipientRightAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> recipientRightAttr , $ posX , $ posY , $ width ... | Set the right recipient attributes |
226,848 | public function setAccountLeftAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> accountLeftAttr , $ posX , $ posY , $ width , $ he... | Set the left account attributes |
226,849 | public function setAccountRightAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> accountRightAttr , $ posX , $ posY , $ width , $ ... | Set the right account attributes |
226,850 | public function setAmountFrancsLeftAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { if ( $ textAlign === null ) { $ textAlign = 'R' ; } $ this -> setAttributes ( $ t... | Set the left francs amount attributes |
226,851 | public function setAmountFrancsRightAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { if ( $ textAlign === null ) { $ textAlign = 'R' ; } $ this -> setAttributes ( $ ... | Set the right francs amount attributes |
226,852 | public function setAmountCentsLeftAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> amountCentsLeftAttr , $ posX , $ posY , $ widt... | Set the left cents amount attributes |
226,853 | public function setAmountCentsRightAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> amountCentsRightAttr , $ posX , $ posY , $ wi... | Set the right cents amount attributes |
226,854 | public function setPayerLeftAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> payerLeftAttr , $ posX , $ posY , $ width , $ height... | Set the left payer attributes |
226,855 | public function setPayerRightAttr ( $ posX = null , $ posY = null , $ width = null , $ height = null , $ background = null , $ fontFamily = null , $ fontSize = null , $ fontColor = null , $ lineHeight = null , $ textAlign = null ) { $ this -> setAttributes ( $ this -> payerRightAttr , $ posX , $ posY , $ width , $ heig... | Set the right payer attributes |
226,856 | public function setDisplayBackground ( $ displayBackground = true ) { $ this -> isBool ( $ displayBackground , 'displayBackground' ) ; $ this -> displayBackground = $ displayBackground ; return $ this ; } | Set whether or not to display the background |
226,857 | public function setDisplayAccount ( $ displayAccount = true ) { $ this -> isBool ( $ displayAccount , 'displayAccount' ) ; $ this -> displayAccount = $ displayAccount ; return $ this ; } | Set whether or not to display the account |
226,858 | public function setDisplayAmount ( $ displayAmount = true ) { $ this -> isBool ( $ displayAmount , 'displayAmount' ) ; $ this -> displayAmount = $ displayAmount ; return $ this ; } | Set whether or not to display the amount |
226,859 | public function setDisplayBank ( $ displayBank = true ) { $ this -> isBool ( $ displayBank , 'displayBank' ) ; $ this -> displayBank = $ displayBank ; return $ this ; } | Set whether or not to display the bank |
226,860 | public function setDisplayPayer ( $ displayPayer = true ) { $ this -> isBool ( $ displayPayer , 'displayPayer' ) ; $ this -> displayPayer = $ displayPayer ; return $ this ; } | Set whether or not to display the payer |
226,861 | public function setDisplayRecipient ( $ displayRecipient = true ) { $ this -> isBool ( $ displayRecipient , 'displayRecipient' ) ; $ this -> displayRecipient = $ displayRecipient ; return $ this ; } | Set whether or not to display the recipient |
226,862 | protected function isIntOrFloat ( $ parameter , $ varName ) { if ( ( ! is_int ( $ parameter ) && ! is_float ( $ parameter ) ) ) { throw new InvalidArgumentException ( sprintf ( '$%s is neither an integer nor a float.' , $ varName ) ) ; } } | Verify that a given parameter is an integer or a float |
226,863 | public function setWithBank ( $ withBank = true ) { $ this -> isBool ( $ withBank , 'withBank' ) ; $ this -> withBank = $ withBank ; if ( $ withBank === false ) { $ this -> bankName = '' ; $ this -> bankCity = '' ; } return $ this ; } | Set if payment slip has a bank specified |
226,864 | public function setWithAccountNumber ( $ withAccountNumber = true ) { $ this -> isBool ( $ withAccountNumber , 'withAccountNumber' ) ; $ this -> withAccountNumber = $ withAccountNumber ; if ( $ withAccountNumber === false ) { $ this -> accountNumber = '' ; } return $ this ; } | Set if payment slip has an account number specified |
226,865 | public function setWithRecipient ( $ withRecipient = true ) { $ this -> isBool ( $ withRecipient , 'withRecipient' ) ; $ this -> withRecipient = $ withRecipient ; if ( $ withRecipient === false ) { $ this -> recipientLine1 = '' ; $ this -> recipientLine2 = '' ; $ this -> recipientLine3 = '' ; $ this -> recipientLine4 =... | Set if payment slip has a recipient specified |
226,866 | public function setWithAmount ( $ withAmount = true ) { $ this -> isBool ( $ withAmount , 'withAmount' ) ; $ this -> withAmount = $ withAmount ; if ( $ withAmount === false ) { $ this -> amount = 0.0 ; } return $ this ; } | Set if payment slip has an amount specified |
226,867 | public function setWithPayer ( $ withPayer = true ) { $ this -> isBool ( $ withPayer , 'withPayer' ) ; $ this -> withPayer = $ withPayer ; if ( $ withPayer === false ) { $ this -> payerLine1 = '' ; $ this -> payerLine2 = '' ; $ this -> payerLine3 = '' ; $ this -> payerLine4 = '' ; } return $ this ; } | Set if payment slip has a payer specified |
226,868 | public function setBankData ( $ bankName , $ bankCity ) { $ this -> setBankName ( $ bankName ) ; $ this -> setBankCity ( $ bankCity ) ; return $ this ; } | Sets the name city and account number of the bank |
226,869 | public function setRecipientData ( $ recipientLine1 , $ recipientLine2 , $ recipientLine3 = '' , $ recipientLine4 = '' ) { $ this -> setRecipientLine1 ( $ recipientLine1 ) ; $ this -> setRecipientLine2 ( $ recipientLine2 ) ; $ this -> setRecipientLine3 ( $ recipientLine3 ) ; $ this -> setRecipientLine4 ( $ recipientLin... | Sets the four lines of the recipient |
226,870 | public function setPayerData ( $ payerLine1 , $ payerLine2 , $ payerLine3 = '' , $ payerLine4 = '' ) { $ this -> setPayerLine1 ( $ payerLine1 ) ; $ this -> setPayerLine2 ( $ payerLine2 ) ; $ this -> setPayerLine3 ( $ payerLine3 ) ; $ this -> setPayerLine4 ( $ payerLine4 ) ; return $ this ; } | Sets the four lines of the payer |
226,871 | protected function getAccountDigits ( ) { if ( ! $ this -> getWithAccountNumber ( ) ) { throw new DisabledDataException ( 'account number' ) ; } if ( $ this -> getNotForPayment ( ) ) { return 'XXXXXXXXX' ; } $ accountNumber = $ this -> getAccountNumber ( ) ; if ( $ accountNumber === '' ) { return $ accountNumber ; } $ ... | Clear the account of the two hyphens |
226,872 | public function getAmountFrancs ( ) { if ( $ this -> getNotForPayment ( ) ) { return 'XXXXXXXX' ; } $ amount = $ this -> getAmount ( ) ; $ francs = intval ( $ amount ) ; return $ francs ; } | Get the francs amount without cents |
226,873 | public function getAmountCents ( ) { if ( $ this -> getNotForPayment ( ) ) { return 'XX' ; } $ amount = $ this -> getAmount ( ) ; $ francs = intval ( $ amount ) ; $ cents = round ( ( $ amount - $ francs ) * 100 ) ; return str_pad ( $ cents , 2 , '0' , STR_PAD_LEFT ) ; } | Get the zero filled right padded two digits long cents amount |
226,874 | protected function modulo10 ( $ number ) { $ next = 0 ; for ( $ i = 0 ; $ i < strlen ( $ number ) ; $ i ++ ) { $ next = $ this -> moduloTable [ ( $ next + intval ( substr ( $ number , $ i , 1 ) ) ) % 10 ] ; } return ( 10 - $ next ) % 10 ; } | Creates Modulo10 recursive check digit |
226,875 | protected function breakStringIntoBlocks ( $ string , $ blockSize = 5 , $ alignFromRight = true ) { if ( $ alignFromRight === true ) { $ string = strrev ( $ string ) ; } $ string = trim ( chunk_split ( $ string , $ blockSize , ' ' ) ) ; if ( $ alignFromRight === true ) { $ string = strrev ( $ string ) ; } return $ stri... | Get a given string broken down in blocks of a certain size |
226,876 | private function parseHostedConfiguration ( array $ configuration , ContainerBuilder $ container ) { $ entityId = [ 'entity_id_route' => $ configuration [ 'metadata' ] [ 'entity_id_route' ] ] ; $ serviceProvider = array_merge ( $ configuration [ 'service_provider' ] , $ entityId ) ; $ identityProvider = array_merge ( $... | Creates and register MetadataConfiguration object based on the configuration given . |
226,877 | protected function useObjectMethod ( $ method , $ value ) { $ currentObject = $ this -> getCurrentObject ( ) ; if ( $ currentObject === null ) { throw new FilterException ( "The target object was not provided to the filter, can't execute method. Please report this." ) ; } if ( ! method_exists ( $ currentObject , $ meth... | Filters by executing a method in the object |
226,878 | public function setWithReferenceNumber ( $ withReferenceNumber = true ) { $ this -> isBool ( $ withReferenceNumber , 'withReferenceNumber' ) ; $ this -> withReferenceNumber = $ withReferenceNumber ; if ( $ withReferenceNumber === false ) { $ this -> referenceNumber = '' ; } return $ this ; } | Set if payment slip has a reference number specified |
226,879 | public function setWithBankingCustomerId ( $ withBankingCustomerId = true ) { $ this -> isBool ( $ withBankingCustomerId , 'withBankingCustomerId' ) ; $ this -> withBankingCustomerId = $ withBankingCustomerId ; if ( $ withBankingCustomerId === false ) { $ this -> bankingCustomerId = '' ; } return $ this ; } | Set if the payment slip s reference number should contain the banking customer ID |
226,880 | public function getCompleteReferenceNumber ( $ formatted = true , $ fillZeros = true ) { $ referenceNumber = $ this -> getReferenceNumber ( ) ; $ notForPayment = $ this -> getNotForPayment ( ) ; $ completeReferenceNumber = $ referenceNumber ; if ( $ notForPayment ) { $ completeReferenceNumber = str_pad ( $ referenceNum... | Get complete reference number |
226,881 | protected function appendCheckDigit ( $ referenceNumber , $ notForPayment = false ) { if ( $ notForPayment === true ) { return $ referenceNumber . 'X' ; } return $ referenceNumber . $ this -> modulo10 ( $ referenceNumber ) ; } | Append the check digit to the reference number |
226,882 | public function getCodeLine ( $ fillZeros = true ) { $ referenceNumber = $ this -> getCompleteReferenceNumber ( false , $ fillZeros ) ; $ accountNumber = $ this -> getAccountDigits ( ) ; if ( $ this -> getWithAmount ( ) ) { $ francs = $ this -> getAmountFrancs ( ) ; $ cents = $ this -> getAmountCents ( ) ; $ francs = s... | Get the full code line at the bottom of the ESR |
226,883 | public function getItems ( $ itemName = null ) { if ( $ itemName && isset ( $ this -> _items [ $ itemName ] ) ) { return $ this -> _items [ $ itemName ] ; } return $ this -> _items ; } | Return thee parents and children of specific item or all items |
226,884 | public function hasParent ( $ itemName , $ parentName ) { $ parents = $ this -> getParents ( $ itemName ) ; if ( in_array ( $ parentName , $ parents ) ) { return true ; } return false ; } | Returns whether the given item has a specific parent . |
226,885 | public function hasChild ( $ itemName , $ childName ) { $ children = $ this -> getChildren ( $ itemName ) ; if ( in_array ( $ childName , $ children ) ) { return true ; } return false ; } | Returns whether the given item has a specific child . |
226,886 | public function hasAncestor ( $ itemName , $ ancestorName ) { $ ancestors = $ this -> getAncestors ( $ itemName ) ; return isset ( $ ancestors [ $ ancestorName ] ) ; } | Returns whether the given item has a specific ancestor . |
226,887 | public function hasDescendant ( $ itemName , $ descendantName ) { $ descendants = $ this -> getDescendants ( $ itemName ) ; return isset ( $ descendants [ $ descendantName ] ) ; } | Returns whether the given item has a specific descendant . |
226,888 | public function getAncestor ( $ itemName , $ depth = 0 ) { $ ancestors = array ( ) ; $ parents = $ this -> getParents ( $ itemName ) ; if ( empty ( $ parents ) ) { $ parents = $ this -> owner -> db -> createCommand ( ) -> select ( 'parent' ) -> from ( $ this -> owner -> itemChildTable ) -> where ( 'child=:child' , arra... | Returns all ancestors for the given item recursively . |
226,889 | public function getDescendant ( $ itemName , $ depth = 0 ) { $ descendants = array ( ) ; $ children = $ this -> getChildren ( $ itemName ) ; if ( empty ( $ children ) ) { $ children = $ this -> owner -> db -> createCommand ( ) -> select ( 'child' ) -> from ( $ this -> owner -> itemChildTable ) -> where ( 'parent=:paren... | Returns all the descendants for the given item recursively . |
226,890 | private function getPermissions ( $ items = null , $ depth = 0 ) { $ permissions = array ( ) ; if ( $ items === null ) { $ items = $ this -> owner -> getAuthItems ( ) ; } foreach ( $ items as $ itemName => $ item ) { $ permissions [ $ itemName ] = array ( 'name' => $ itemName , 'item' => $ item , 'children' => $ this -... | Returns the permission tree for the given items . |
226,891 | private function getItemPermissions ( $ itemName ) { $ item = $ this -> owner -> getAuthItem ( $ itemName ) ; return $ item instanceof CAuthItem ? $ this -> getPermissions ( $ item -> getChildren ( ) ) : array ( ) ; } | Builds the permissions for the given item . |
226,892 | public function getItemsPermissions ( $ names ) { $ permissions = array ( ) ; $ items = $ this -> getPermissions ( ) ; $ flat = $ this -> flattenPermissions ( $ items ) ; foreach ( $ flat as $ itemName => $ item ) { if ( in_array ( $ itemName , $ names ) ) { $ permissions [ $ itemName ] = $ item ; } } return $ permissi... | Returns the permissions for the items with the given names . |
226,893 | public function flattenPermissions ( $ permissions ) { $ flattened = array ( ) ; foreach ( $ permissions as $ itemName => $ itemPermissions ) { $ flattened [ $ itemName ] = $ itemPermissions ; if ( isset ( $ itemPermissions [ 'children' ] ) ) { $ children = $ itemPermissions [ 'children' ] ; unset ( $ itemPermissions [... | Flattens the given permission tree . |
226,894 | public function checkAccess ( $ operation , $ params = array ( ) , $ allowCaching = true ) { if ( $ this -> getIsAdmin ( ) ) { return true ; } return parent :: checkAccess ( $ operation , $ params , $ allowCaching ) ; } | Performs access check for this user . |
226,895 | protected function walkObject ( $ object , $ limitProperty = null ) { if ( $ object === null ) { return ; } $ metadata = $ this -> metadataFactory -> getClassMetadata ( get_class ( $ object ) ) ; $ walker = new ObjectWalker ( $ object , $ this -> filterLoader ) ; $ properties = ( $ limitProperty !== null ) ? array ( $ ... | Iterates over annotated properties in an object filtering the selected values |
226,896 | public function actionIndex ( ) { $ dataProvider = new AuthItemDataProvider ( ) ; $ dataProvider -> type = $ this -> type ; $ this -> render ( 'index' , array ( 'dataProvider' => $ dataProvider , ) ) ; } | Displays a list of items of the given type . |
226,897 | public function actionCreate ( ) { $ model = new AuthItemForm ( 'create' ) ; if ( isset ( $ _POST [ 'AuthItemForm' ] ) ) { $ model -> attributes = $ _POST [ 'AuthItemForm' ] ; if ( $ model -> validate ( ) ) { $ am = Yii :: app ( ) -> getAuthManager ( ) ; if ( ( $ item = $ am -> getAuthItem ( $ model -> name ) ) === nul... | Displays a form for creating a new item of the given type . |
226,898 | public function actionUpdate ( $ name ) { $ am = Yii :: app ( ) -> getAuthManager ( ) ; $ item = $ am -> getAuthItem ( $ name ) ; if ( $ item === null ) { throw new CHttpException ( 404 , Yii :: t ( 'AuthModule.main' , 'Page not found.' ) ) ; } $ model = new AuthItemForm ( 'update' ) ; if ( isset ( $ _POST [ 'AuthItemF... | Displays a form for updating the item with the given name . |
226,899 | public function actionView ( $ name ) { $ formModel = new AddAuthItemForm ( ) ; $ am = Yii :: app ( ) -> getAuthManager ( ) ; if ( isset ( $ _POST [ 'AddAuthItemForm' ] ) ) { $ formModel -> attributes = $ _POST [ 'AddAuthItemForm' ] ; if ( $ formModel -> validate ( ) ) { if ( ! $ am -> hasItemChild ( $ name , $ formMod... | Displays the item with the given name . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.