idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
8,300
public final function setMethodArguments ( string $ method , array $ methodArguments ) : self { $ this -> methodArguments [ $ method ] = $ methodArguments ; return $ this ; }
Set method arguments .
8,301
public final function getMethodArguments ( string $ method = null ) : ? array { return $ method ? $ this -> methodArguments [ $ method ] ?? null : $ this -> methodArguments ; }
Get method arguments .
8,302
public final function isAllowedRequestMethod ( string $ method ) : bool { return $ this -> allowedRequestMethods == null || in_array ( $ method , ( array ) $ this -> allowedRequestMethods ) ; }
Is allowed request method .
8,303
public final function getShortName ( ) : ? string { return ( $ this -> name != null ) ? substr ( $ this -> name , 0 , - strlen ( self :: SERVICE_NAME_SUFFIX ) ) : null ; }
Get short name .
8,304
private final function loadAcl ( ) : void { $ this -> acl = new Acl ( $ this ) ; $ rules = $ this -> config -> get ( 'acl.rules' ) ; if ( $ rules != null ) { $ this -> acl -> setRules ( $ rules ) ; } }
Load acl .
8,305
private final function loadValidation ( ) : void { $ this -> validation = new Validation ( ) ; $ rules = $ this -> config -> get ( 'validation.rules' ) ; if ( $ rules != null ) { $ this -> validation -> setRules ( $ rules ) ; } }
Load validation .
8,306
final public static function spaceName ( string $ fullName = null ) : string { $ fullName = $ fullName ? : self :: fullName ( ) ; $ fullName = \ str_replace ( '\\' , '/' , $ fullName ) ; return \ strpos ( $ fullName , '/' ) ? \ dirname ( $ fullName ) : null ; }
get called class namespace
8,307
public function prepare ( $ item ) { $ prepared = array ( ) ; foreach ( $ item as $ key => $ value ) { if ( $ value === null ) { $ prepared [ $ key ] = null ; continue ; } if ( is_array ( $ value ) ) { $ prepared [ $ key ] = $ this -> prepare ( $ value ) ; continue ; } if ( is_scalar ( $ value ) ) { $ prepared [ $ key ...
Make everything into a string remove empty strings
8,308
public function insert ( $ runValidation = true , $ attributes = null ) { try { return parent :: insert ( $ runValidation , $ attributes ) ; } catch ( \ Exception $ ex ) { throw new Exception ( $ ex -> getMessage ( ) , $ ex -> getCode ( ) , $ ex ) ; } catch ( \ Throwable $ ex ) { throw new Exception ( $ ex -> getMessag...
Inserts a row into the associated database table using the attribute values of this record .
8,309
public function invalidateCache ( ) { if ( ! $ this -> isNewRecord ) { $ cache = Yii :: $ app -> cache ; if ( $ cache !== null ) { $ key = $ this -> getCacheKey ( ) ; if ( $ key != null ) { Yii :: debug ( sprintf ( "Clear cache key %s" , $ key ) ) ; $ cache -> delete ( $ key ) ; } $ tags = $ this -> getCacheTag ( ) ; i...
Invalidate cache related for object
8,310
protected function applyStyles ( $ row , $ col , array $ styles ) : bool { $ buffer = $ this -> getBuffer ( ) ; if ( ! isset ( $ buffer [ $ row ] ) ) { return false ; } if ( ! isset ( $ buffer [ $ row ] [ $ col ] ) ) { return false ; } $ current_styles = $ this -> buffer [ $ row ] [ $ col ] [ 'styles' ] ; $ results = [...
Aplica os estilos com base nos indices PHP .
8,311
protected function applyBorderStyle ( $ row , $ col , string $ param , $ value ) : bool { $ buffer = $ this -> getBuffer ( ) ; if ( ! isset ( $ buffer [ $ row ] ) ) { return false ; } if ( ! isset ( $ buffer [ $ row ] [ $ col ] ) ) { return false ; } $ names = explode ( '-' , $ param ) ; $ direction = $ names [ 1 ] ; s...
Aplica os estilos para bordas com base nos indices PHP .
8,312
public function setOptions ( ? array & $ options , string $ keyKey , string $ labelKey ) { $ this -> options = $ options ; $ this -> keyKey = $ keyKey ; $ this -> labelKey = $ labelKey ; }
Sets the options for this select box .
8,313
private function optionAttributes ( array $ option ) : array { $ attributes = [ ] ; if ( is_array ( $ this -> optionAttributesMap ) ) { foreach ( $ this -> optionAttributesMap as $ key => $ name ) { if ( isset ( $ option [ $ key ] ) ) $ attributes [ $ name ] = $ option [ $ key ] ; } } return $ attributes ; }
Returns the attributes for the option element .
8,314
public function resolveDomain ( string $ bundle ) : string { $ bundle = strtolower ( str_replace ( [ '/' , '\\' ] , '-' , $ bundle ) ) ; foreach ( $ this -> config [ 'domains' ] as $ domain => $ patterns ) { foreach ( $ patterns as $ pattern ) { if ( $ this -> matcher -> matches ( $ bundle , $ pattern ) ) { return $ do...
Get domain name associated with given bundle .
8,315
public function find ( string $ pattern , int $ flags = 0 ) : Collection { $ files = glob ( $ this -> path . '/' . $ pattern , $ flags ) ; foreach ( $ files as $ index => $ file ) { if ( is_dir ( $ file ) ) { $ files [ $ index ] = new self ( $ file ) ; } else { $ files [ $ index ] = new File ( $ file ) ; } } return new...
Find sub files and folders matching a pattern .
8,316
public function findFiles ( string $ pattern , int $ flags = 0 ) : FileCollection { $ files = glob ( $ this -> path . '/' . $ pattern , $ flags ) ; foreach ( $ files as $ index => $ file ) { if ( is_file ( $ file ) ) { $ files [ $ index ] = new File ( $ file ) ; } else { unset ( $ files [ $ index ] ) ; } } return new F...
Find sub files matching a pattern .
8,317
public function findFolders ( string $ pattern , int $ flags = 0 ) : FolderCollection { $ folders = glob ( $ this -> path . '/' . $ pattern , $ flags ) ; foreach ( $ folders as $ index => $ folder ) { if ( is_dir ( $ folder ) ) { $ folders [ $ index ] = new self ( $ folder ) ; } else { unset ( $ folders [ $ index ] ) ;...
Find sub folders matching a pattern .
8,318
public function addFile ( File $ file ) : self { $ directory = $ this -> getPath ( ) ; $ file -> moveToDirectory ( $ directory ) ; return $ this ; }
Add file to the folder .
8,319
public function addFiles ( Collection $ files ) : self { foreach ( $ files as $ file ) { $ this -> addFile ( $ file ) ; } return $ this ; }
Add files to the folder .
8,320
public function rename ( string $ newFolderName ) : self { $ newFolderPath = normalize_path ( $ this -> getDirectory ( ) . DIRECTORY_SEPARATOR . $ newFolderName ) ; if ( $ newFolderPath === $ this -> getPath ( ) || ( ! is_dir ( $ newFolderPath ) && $ this -> move ( $ newFolderPath ) ) ) { return self :: load ( $ newFol...
Rename folder with new folder name .
8,321
public function move ( string $ newFolderPath ) : self { $ newFolderPath = normalize_path ( $ newFolderPath ) ; if ( ! is_dir ( $ newFolderPath ) ) { if ( rename ( $ this -> path , $ newFolderPath ) ) { return new self ( $ newFolderPath ) ; } throw new FolderException ( 'Cannot move folder to the new folder path (' . $...
Move folder to directory and rename it .
8,322
public function moveToDirectory ( string $ newDirectoryPath ) : self { $ newDirectoryPath = normalize_path ( $ newDirectoryPath ) ; if ( is_dir ( $ newDirectoryPath ) ) { if ( is_writeable ( $ newDirectoryPath ) ) { $ newFolderPath = $ newDirectoryPath . DIRECTORY_SEPARATOR . $ this -> getName ( ) ; return $ this -> mo...
Move folder to new directory .
8,323
public function copy ( string $ newFolderPath ) : self { $ newFolderPath = normalize_path ( $ newFolderPath ) ; if ( ! is_dir ( $ newFolderPath ) ) { $ newFolder = self :: create ( $ newFolderPath ) ; if ( $ this -> copyContent ( $ newFolder -> getPath ( ) ) ) { return $ newFolder ; } throw new FolderException ( 'Canno...
Copy folder to new directory and rename it .
8,324
public function copyToDirectory ( string $ newDirectoryPath ) : self { $ newDirectoryPath = normalize_path ( $ newDirectoryPath ) ; if ( is_dir ( $ newDirectoryPath ) ) { if ( is_writeable ( $ newDirectoryPath ) ) { $ newFolderPath = $ newDirectoryPath . DIRECTORY_SEPARATOR . $ this -> getName ( ) ; $ this -> copy ( $ ...
Copy folder to new directory path .
8,325
protected function request ( $ path , $ method , array $ data = array ( ) ) { $ request = new Request ( ) ; $ response = new Response ( ) ; $ transport = $ this -> getTransport ( ) ; $ request -> setMethod ( $ method ) ; $ request -> setResource ( $ this -> buildPath ( $ path ) ) ; $ request -> setHost ( self :: URI ) ...
Helper to send requests to Metrics API .
8,326
public static function loadPhp ( $ file , $ throwError = true ) : array { $ ary = [ ] ; if ( is_file ( $ file ) ) { $ ary = require $ file ; if ( ! \ is_array ( $ ary ) ) { $ ary = [ ] ; } } elseif ( $ throwError ) { throw new FileNotFoundException ( "php file [$file] not exists." ) ; } return $ ary ; }
load array data form file .
8,327
public function uploadFileByContent ( File $ file , string $ content ) { $ dir = sys_get_temp_dir ( ) ; $ tmp = $ dir . '/' . Uuid :: uuid4 ( ) -> toString ( ) ; file_put_contents ( $ tmp , $ content ) ; $ filename = $ file -> name ; if ( ! $ filename ) { $ filename = Uuid :: uuid4 ( ) -> toString ( ) . '.' . $ this ->...
Upload file By content .
8,328
public function uploadFileFromFilesystem ( File $ file , string $ path ) { $ dir = sys_get_temp_dir ( ) ; $ filename = $ dir . '/' . Uuid :: uuid4 ( ) -> toString ( ) . '.' . $ this -> guessExtension ( $ path ) ; rename ( $ path , $ filename ) ; $ file -> path = $ filename ; $ file -> save ( ) ; $ file -> addMedia ( $ ...
Upload a file from filesystem .
8,329
public function getBase ( ) { $ orderTable = CartTables :: getTableName ( CartTables :: TABLE_ORDER ) ; return $ this -> hasOne ( Order :: class , [ 'id' => 'baseId' ] ) -> from ( "$orderTable as base" ) ; }
Returns the parent order .
8,330
public function getTransaction ( ) { $ transactionTable = PaymentTables :: getTableName ( PaymentTables :: TABLE_TRANSACTION ) ; $ transactionSuccess = Transaction :: STATUS_SUCCESS ; return $ this -> hasOne ( Transaction :: class , [ 'orderId' => 'id' ] ) -> where ( "$transactionTable.status=$transactionSuccess" ) ; }
Returns the successful transaction associated with the order .
8,331
public function isApproved ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_APPROVED ; } return $ this -> status >= self :: STATUS_APPROVED ; }
Check whether order is approved .
8,332
public function isPlaced ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_PLACED ; } return $ this -> status >= self :: STATUS_PLACED ; }
Check whether order is placed .
8,333
public function isCancelled ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_CANCELLED ; } return $ this -> status >= self :: STATUS_CANCELLED ; }
Check whether order is cancelled .
8,334
public function isPaid ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_PAID ; } return $ this -> status >= self :: STATUS_PAID ; }
Check whether order is paid .
8,335
public function isRefunded ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_REFUNDED ; } return $ this -> status >= self :: STATUS_REFUNDED ; }
Check whether order is refunded .
8,336
public function isConfirmed ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_CONFIRMED ; } return $ this -> status >= self :: STATUS_CONFIRMED ; }
Check whether order is confirmed .
8,337
public function isProcessed ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_PROCESSED ; } return $ this -> status >= self :: STATUS_PROCESSED ; }
Check whether order is processed .
8,338
public function isShipped ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_SHIPPED ; } return $ this -> status >= self :: STATUS_SHIPPED ; }
Check whether order is shipped .
8,339
public function isDelivered ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_DELIVERED ; } return $ this -> status >= self :: STATUS_DELIVERED ; }
Check whether order is delivered .
8,340
public function isReturned ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_RETURNED ; } return $ this -> status >= self :: STATUS_RETURNED ; }
Check whether order is returned .
8,341
public function isDispute ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_DISPUTE ; } return $ this -> status >= self :: STATUS_DISPUTE ; }
Check whether order is under dispute .
8,342
public function isCompleted ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_COMPLETED ; } return $ this -> status >= self :: STATUS_COMPLETED ; }
Check whether order is completed .
8,343
public function isPrintable ( $ strict = true ) { if ( $ strict ) { return $ this -> status == self :: STATUS_COMPLETED ; } return in_array ( $ this -> status , [ self :: STATUS_PAID , self :: STATUS_DELIVERED , self :: STATUS_COMPLETED ] ) ; }
Check whether order is printable .
8,344
public function getMany ( ... $ keys ) { $ ret = [ ] ; foreach ( $ this -> normalizeKeys ( $ keys ) as $ key ) { if ( $ this -> has ( $ key ) ) { $ ret [ $ key ] = $ this -> proxy -> { $ key } ; } } return $ ret ; }
Get properties if they exist .
8,345
public function addProperties ( array $ values ) { foreach ( $ values as $ key => $ value ) { $ this -> add ( $ key , $ value ) ; } return $ this ; }
Add many properties .
8,346
public function reduce ( ... $ keys ) { $ keys = $ this -> normalizeKeys ( $ keys ) ; foreach ( $ this -> keys ( ) as $ key ) { if ( ! in_array ( $ key , $ keys , true ) ) { $ this -> remove ( $ key ) ; } } return $ this ; }
Reduce this object so that it only has the supplied allowed keys .
8,347
public function rename ( $ currentKey , $ newKey ) { if ( $ this -> has ( $ currentKey ) ) { $ this -> set ( $ newKey , $ this -> proxy -> { $ currentKey } ) -> remove ( $ currentKey ) ; } return $ this ; }
If the object has the current key rename it to the new key name .
8,348
public function renameKeys ( array $ mapping ) { foreach ( $ mapping as $ currentKey => $ newKey ) { $ this -> rename ( $ currentKey , $ newKey ) ; } return $ this ; }
Rename many current keys to new keys .
8,349
public static function addRow ( DetailTable $ table , $ header , ? string $ text ) : void { if ( $ text !== null && $ text !== '' ) { $ table -> addRow ( $ header , [ 'class' => 'text' ] , $ text ) ; } else { $ table -> addRow ( $ header ) ; } }
Adds a row with a text value to a detail table .
8,350
public static function getCurrentDir ( $ object ) { if ( empty ( $ object ) ) { return '' ; } $ child = new \ ReflectionClass ( $ object ) ; return dirname ( $ child -> getFileName ( ) ) ; }
Get the current directory of the extended class object
8,351
public function lower ( $ key ) { if ( $ this -> root ) { $ lower = $ this -> root -> find ( $ key , $ this -> comparator , - 2 ) ; } else { $ lower = null ; } if ( $ lower ) { return $ lower ; } else { throw new \ OutOfBoundsException ( 'Lower element unexisting' ) ; } }
Returns the element whose key is the greatest key lesser than the given key or throw an exception if there is no such element
8,352
public function floor ( $ key ) { if ( $ this -> root ) { $ floor = $ this -> root -> find ( $ key , $ this -> comparator , - 1 ) ; } else { $ floor = null ; } if ( $ floor ) { return $ floor ; } else { throw new \ OutOfBoundsException ( 'Floor element unexisting' ) ; } }
Returns the element whose key is the greatest key lesser than or equal to the given key or throw an exception if there is no such element
8,353
public function find ( $ key ) { if ( $ this -> root ) { $ find = $ this -> root -> find ( $ key , $ this -> comparator , 0 ) ; } else { $ find = null ; } if ( $ find ) { return $ find ; } else { throw new \ OutOfBoundsException ( 'Element unexisting' ) ; } }
Returns the element whose key is equal to the given key or throw an exception if there is no such element
8,354
public function ceiling ( $ key ) { if ( $ this -> root ) { $ ceiling = $ this -> root -> find ( $ key , $ this -> comparator , 1 ) ; } else { $ ceiling = null ; } if ( $ ceiling ) { return $ ceiling ; } else { throw new \ OutOfBoundsException ( 'Ceiling element unexisting' ) ; } }
Returns the element whose key is the lowest key greater than or equal to the given key or throw an exception if there is no such element
8,355
public function higher ( $ key ) { if ( $ this -> root ) { $ higher = $ this -> root -> find ( $ key , $ this -> comparator , 2 ) ; } else { $ higher = null ; } if ( $ higher ) { return $ higher ; } else { throw new \ OutOfBoundsException ( 'Higher element unexisting' ) ; } }
Returns the element whose key is the lowest key greater than to the given key or throw an exception if there is no such element
8,356
public function putAll ( $ map ) { foreach ( $ map as $ key => $ val ) { $ this -> put ( $ key , $ val ) ; } return $ this ; }
Initialise the map
8,357
public function offsetSet ( $ key , $ value ) { if ( $ this -> root ) { $ this -> root = $ this -> root -> insert ( $ key , $ value , $ this -> comparator ) ; } else { $ this -> root = TreeNode :: create ( $ key , $ value ) ; } }
Set the value for a key
8,358
public function offsetUnset ( $ key ) { if ( $ this -> root ) { $ this -> root = $ this -> root -> remove ( $ key , $ this -> comparator ) ; } }
Unset the existence of a key
8,359
public function containsValue ( $ value ) { foreach ( $ this -> values ( ) as $ v ) { if ( $ v === $ value ) { return true ; } } return false ; }
Returns true if this map maps one or more keys to the specified value .
8,360
public function keySet ( ) { $ result = [ ] ; $ keys = $ this -> keys ( ) ; foreach ( $ keys as $ key ) { $ result [ ] = $ key ; } return $ result ; }
Returns a set view of the keys contained in this map .
8,361
public function addClass ( ? string $ class ) : void { if ( $ class === null || $ class === '' ) return ; if ( isset ( $ this -> attributes [ 'class' ] ) ) { $ this -> attributes [ 'class' ] .= ' ' ; $ this -> attributes [ 'class' ] .= $ class ; } else { $ this -> attributes [ 'class' ] = $ class ; } }
Adds a class to the list of classes .
8,362
public function removeClass ( ? string $ class ) : void { if ( $ class === null || $ class === '' || ! isset ( $ this -> attributes [ 'class' ] ) ) return ; $ this -> attributes [ 'class' ] = implode ( ' ' , array_diff ( explode ( ' ' , $ this -> attributes [ 'class' ] ) , [ $ class ] ) ) ; }
Removes a class from the list of classes .
8,363
public function setFakeAttribute ( string $ name , $ value ) : void { if ( strpos ( $ name , '_' ) !== 0 ) { throw new LogicException ( "Attribute '%s' is not a valid fake attribute." , $ name ) ; } $ this -> attributes [ $ name ] = $ value ; }
Sets a fake attribute . A fake attribute has a name that starts with an underscore . Fake attributes will not be included in the generated HTML code .
8,364
public static function setPermissions ( Event $ event ) { if ( 'WIN' === strtoupper ( substr ( PHP_OS , 0 , 3 ) ) ) { $ event -> getIO ( ) -> write ( '<info>No permissions setup is required on Windows.</info>' ) ; return ; } $ event -> getIO ( ) -> write ( 'Setting up permissions.' ) ; try { self :: setPermissionsChmod...
An event that triggers setting writable permissions on any directories specified in the writable - dirs composer extra options
8,365
public static function getWritableDirs ( Event $ event ) { $ configuration = $ event -> getComposer ( ) -> getPackage ( ) -> getExtra ( ) ; if ( ! isset ( $ configuration [ 'writable-dirs' ] ) ) { throw new \ Exception ( 'The writable-dirs must be specified in composer arbitrary extra data.' ) ; } if ( ! is_array ( $ c...
returns a list of writeable directories specified in the writeable - dirs composer extra options
8,366
public static function setPermissionsSetfacl ( Event $ event ) { $ http_user = self :: getHttpdUser ( $ event ) ; foreach ( self :: getWritableDirs ( $ event ) as $ path ) { self :: SetfaclPermissionsSetter ( $ event , $ http_user , $ path ) ; } foreach ( self :: getWritableFiles ( $ event ) as $ path ) { self :: Chmod...
Sets Writrable Directory permissions for any directories listed in the writeable - dirs option using setfacl
8,367
public static function setPermissionsChmod ( Event $ event ) { $ http_user = self :: getHttpdUser ( $ event ) ; foreach ( self :: getWritableDirs ( $ event ) as $ path ) { self :: ChmodPermissionsSetter ( $ event , $ http_user , $ path , 'dir' ) ; } foreach ( self :: getWritableFiles ( $ event ) as $ path ) { self :: C...
Sets Writrable Directory permissions for any directories listed in the writeable - dirs option using chmod
8,368
public static function getHttpdUser ( Event $ event ) { $ ps = self :: runProcess ( $ event , 'ps aux' ) ; preg_match_all ( '/^.*([a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx)$/m' , $ ps , $ matches ) ; foreach ( $ matches [ 0 ] as $ match ) { $ user = substr ( $ match , 0 , strpos ( $ match , ' ' ) ) ; if ( $ user != 'r...
returns the user the webserver is running as
8,369
public static function EnsureDirExists ( Event $ event , $ path ) { if ( ! is_dir ( $ path ) ) { mkdir ( $ path , 0777 , true ) ; if ( ! is_dir ( $ path ) ) { throw new \ Exception ( 'Path Not Found: ' . $ path ) ; } if ( $ event -> getIO ( ) -> isVerbose ( ) === true ) { $ event -> getIO ( ) -> write ( sprintf ( 'Crea...
checks if the given directory exists and if not tries to create it .
8,370
public static function EnsureFileExists ( Event $ event , $ path ) { if ( ! is_dir ( dirname ( $ path ) ) ) { mkdir ( dirname ( $ path ) , 0777 , true ) ; touch ( $ path ) ; if ( ! file_exists ( $ path ) ) { throw new \ Exception ( 'File Not Found: ' . $ path ) ; } if ( $ event -> getIO ( ) -> isVerbose ( ) === true ) ...
checks if the given file exists and if not tries to create it .
8,371
public static function runProcess ( Event $ event , $ commandline ) { if ( $ event -> getIO ( ) -> isVerbose ( ) === true ) { $ event -> getIO ( ) -> write ( sprintf ( 'Running <info>%s</info>' , $ commandline ) ) ; } exec ( $ commandline , $ output , $ return ) ; if ( $ return != 0 ) { throw new \ Exception ( 'Returne...
runs a command process returning the output and checking return code
8,372
public static function findByFormSubmitId ( $ formSubmitId ) { $ frmSubmitTable = FormTables :: getTableName ( FormTables :: TABLE_FORM_SUBMIT ) ; $ query = static :: find ( ) -> joinWith ( 'formSubmit' ) -> where ( "$frmSubmitTable.id=:id" , [ ':id' => $ formSubmitId ] ) ; return $ query -> all ( ) ; }
Find and return the form submit fields associated with given form submit id .
8,373
public static function findByName ( $ formSubmitId , $ name ) { $ frmSubmitTable = FormTables :: getTableName ( FormTables :: TABLE_FORM_SUBMIT ) ; $ frmSubmitFieldTable = FormTables :: getTableName ( FormTables :: TABLE_FORM_SUBMIT_FIELD ) ; $ query = static :: find ( ) -> joinWith ( 'formSubmit' ) -> where ( "$frmSub...
Find and return the form submit field associated with given form submit id and name .
8,374
public function addTablePrefix ( string $ table ) : string { return ( $ this -> tablePrefixer ?? $ this -> database -> getTablePrefixer ( ) ) -> addTablePrefix ( $ table ) ; }
Adds the table prefix to a table name .
8,375
public function addTablePrefixToColumn ( string $ column ) : string { return ( $ this -> tablePrefixer ?? $ this -> database -> getTablePrefixer ( ) ) -> addTablePrefixToColumn ( $ column ) ; }
Adds the table prefix to a column name which may contain table name or alias .
8,376
public function escapeLikeWildcards ( string $ string ) : string { return ( $ this -> grammar ?? $ this -> database -> getGrammar ( ) ) -> escapeLikeWildcards ( $ string ) ; }
Escapes the LIKE operator special characters . Doesn t escape general string wildcard characters because it is another job .
8,377
public function getCurrent ( ) { if ( $ this -> current === null ) { $ this -> current = false ; $ item = $ this -> getFromSession ( ) ; if ( ! $ item ) { $ item = $ this -> getFromCookie ( ) ; } if ( $ item && $ this -> checkAccessCurrent ( $ item ) ) { $ this -> beforeSetCurrent ( $ item ) ; $ this -> setAndSaveCurre...
Get current Persisted record
8,378
public function getFromSession ( ) { $ sessionInfo = $ this -> getCurrentSessionData ( ) ; if ( is_array ( $ sessionInfo ) ) { if ( isset ( $ sessionInfo [ 'id' ] ) && ! empty ( $ sessionInfo [ 'id' ] ) ) { $ recordId = intval ( $ sessionInfo [ 'id' ] ) ; return $ this -> findOne ( $ recordId ) ; } } return false ; }
Get persisted Record from Session
8,379
public function getCurrentSessionData ( ) { $ varName = $ this -> getCurrentVarName ( ) ; return isset ( $ _SESSION [ $ varName ] ) ? $ _SESSION [ $ varName ] : null ; }
Get session data for persistent record from session
8,380
public function setAndSaveCurrent ( $ item = false ) { $ this -> setCurrent ( $ item ) ; $ this -> savePersistCurrent ( $ item ) ; return $ this ; }
Set and save persisted model
8,381
public function savePersistCurrentCookie ( $ item ) { $ varName = $ this -> getCurrentVarName ( ) ; CookieJar :: instance ( ) -> newCookie ( ) -> setName ( $ varName ) -> setValue ( $ item -> id ) -> save ( ) ; }
Save record in Cookie
8,382
public function getFromCookie ( ) { $ varName = $ this -> getCurrentVarName ( ) ; if ( isset ( $ _COOKIE [ $ varName ] ) ) { $ recordId = $ _COOKIE [ $ varName ] ; $ item = $ this -> findOne ( intval ( $ recordId ) ) ; if ( $ item ) { return $ item ; } } return false ; }
Get persistent record from Cookie
8,383
public function validate ( Control $ control ) : bool { return ( $ this -> data === null ) ? ( $ this -> callable ) ( $ control ) : ( $ this -> callable ) ( $ control , $ this -> data ) ; }
Returns true if the value of the form control meets the conditions of this validator . Returns false otherwise .
8,384
public function triggerActivity ( $ slug , $ data , $ config = [ ] ) { if ( ! Yii :: $ app -> core -> isActivities ( ) ) { return false ; } $ template = $ this -> templateService -> getBySlugType ( $ slug , NotifyGlobal :: TYPE_ACTIVITY ) ; if ( empty ( $ template ) || ! $ template -> isActive ( ) ) { return ; } $ mess...
Trigger Activity using given template message and config
8,385
public function getResponseError ( ResponseInterface $ response ) { if ( $ this -> isError ( $ response ) ) { $ error = $ this -> getError ( $ response ) ; if ( in_array ( $ error , [ 'invalid_token' , 'not_allowed_ip' ] , true ) ) { $ this -> app -> user -> logout ( ) ; $ this -> app -> response -> refresh ( ) -> send...
Calls fixResponse .
8,386
public function setLogDirectory ( ? string $ path ) : self { if ( null !== $ path ) { if ( ! is_dir ( $ path ) ) { throw new InvalidArgumentException ( sprintf ( "Tracy log path '%s' does`t exists" , $ path ) ) ; } $ path = realpath ( $ path ) ; } $ this -> logDirectory = $ path ; return $ this ; }
Path to log directory
8,387
public function setLiveUpdateURL ( $ liveUpdateURL = 'https://secure.epayment.ro/order/lu.php' ) { if ( ! is_string ( $ liveUpdateURL ) ) { return false ; } if ( empty ( $ liveUpdateURL ) ) { return false ; } $ this -> liveUpdateURL = $ liveUpdateURL ; return true ; }
setLiveUpdateURL class method
8,388
public function setLanguage ( $ language = 'ro' ) { $ language = trim ( strtolower ( $ language ) ) ; switch ( $ language ) { case 'ro' : $ this -> language = 'ro' ; break ; case 'en' : default : $ this -> language = 'en' ; } return true ; }
setLanguage class method
8,389
public function setSecretKey ( $ secretKey ) { if ( ! is_string ( $ secretKey ) ) { $ this -> secretKeyError = 'invalid type' ; return false ; } if ( empty ( $ secretKey ) ) { $ this -> secretKeyError = 'empty string' ; return false ; } if ( strlen ( $ secretKey ) > 64 ) { $ this -> secretKeyError = 'secret key is leng...
setSecretKey class method
8,390
public function setOrderDate ( $ orderDate = '' ) { if ( strtotime ( $ orderDate ) === - 1 ) { $ this -> orderDate = null ; return false ; } $ dateFormatPattern = "^((((19|20)(([02468][048])|([13579][26]))-02-29))|((20[0-9][0-9])|(19[0-9][0-9]))-((((0[1-9])|(1[0-2]))-((0[1-9])|(1\d)|(2[0-8])))|((((0[13578])|(1[02]))-31...
setOrderDate class method
8,391
public function setOrderPName ( $ orderPName ) { if ( ! is_array ( $ orderPName ) ) { $ this -> orderPName = null ; return false ; } $ isValid = true ; $ index = 0 ; while ( $ isValid && $ index < count ( $ orderPName ) ) { if ( strlen ( $ orderPName [ $ index ] ) > 155 ) { $ isValid = false ; } else { $ isValid = true...
setOrderPName class method
8,392
public function setOrderPGroup ( $ orderPGroup ) { if ( ! is_array ( $ orderPGroup ) ) { $ this -> orderPGroup = null ; return false ; } $ isValid = true ; $ index = 0 ; while ( $ isValid && $ index < count ( $ orderPGroup ) ) { if ( strlen ( $ orderPGroup [ $ index ] ) > 155 ) { $ isValid = false ; } else { $ isValid ...
setOrderPGroup class method
8,393
public function setOrderPType ( $ orderPType ) { if ( ! is_array ( $ orderPType ) ) { $ this -> orderPType = null ; return false ; } $ isValid = true ; $ index = 0 ; while ( $ isValid && $ index < count ( $ orderPType ) ) { if ( ! in_array ( $ orderPType [ $ index ] , array ( 'GROSS' , 'NET' ) ) ) { $ isValid = false ;...
setOrderPType class method
8,394
public function setOrderPCode ( $ orderPCode ) { if ( ! is_array ( $ orderPCode ) ) { $ this -> orderPCode = null ; return false ; } $ isValid = true ; $ index = 0 ; while ( $ isValid && $ index < count ( $ orderPCode ) ) { if ( strlen ( $ orderPCode [ $ index ] ) > 20 ) { $ isValid = false ; } else { $ isValid = true ...
setOrderPCode class method
8,395
public function setOrderPInfo ( $ orderPInfo ) { if ( ! is_array ( $ orderPInfo ) ) { $ this -> orderPInfo = null ; return false ; } $ this -> orderPInfo = $ orderPInfo ; return true ; }
setOrderPInfo class method
8,396
public function setOrderPrice ( $ orderPrice ) { if ( ! is_array ( $ orderPrice ) ) { $ this -> orderPrice = null ; return false ; } $ isValid = true ; $ index = 0 ; while ( $ isValid && $ index < count ( $ orderPrice ) ) { if ( is_numeric ( $ orderPrice [ $ index ] ) && $ orderPrice [ $ index ] > 0 ) { $ isValid = tru...
setOrderPrice class method
8,397
public function setOrderQTY ( $ orderQty ) { if ( ! is_array ( $ orderQty ) ) { $ this -> orderQty = null ; return false ; } $ isValid = true ; $ index = 0 ; while ( $ isValid && $ index < count ( $ orderQty ) ) { if ( is_numeric ( $ orderQty [ $ index ] ) && $ orderQty [ $ index ] > 0 ) { $ isValid = true ; } else { $...
setOrderQTY class method
8,398
public function setOrderVAT ( $ orderVAT ) { if ( ! is_array ( $ orderVAT ) ) { $ this -> orderVAT = null ; return false ; } $ isValid = true ; $ index = 0 ; while ( $ isValid && $ index < count ( $ orderVAT ) ) { if ( is_numeric ( $ orderVAT [ $ index ] ) && $ orderVAT [ $ index ] >= 0 && $ orderVAT [ $ index ] < 100 ...
setOrderVAT class method
8,399
public function setOrderVer ( $ orderVer ) { if ( ! is_array ( $ orderVer ) ) { $ this -> orderVer = null ; return false ; } $ isValid = true ; $ index = 0 ; while ( $ isValid && $ index < count ( $ orderVer ) ) { if ( settype ( $ orderVer [ $ index ] , "string" ) ) { if ( strlen ( $ orderVer [ $ index ] ) < 51 ) { $ i...
setOrderVer class method