idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
231,700
public function getParent ( ConnectionInterface $ con = null ) { if ( null === $ this -> aNestedSetParent && $ this -> hasParent ( ) ) { $ this -> aNestedSetParent = ChildCategoryQuery :: create ( ) -> ancestorsOf ( $ this ) -> orderByLevel ( true ) -> findOne ( $ con ) ; } return $ this -> aNestedSetParent ; }
Gets parent node for the current object if it exists The result is cached so further calls to the same method don t issue any queries
231,701
public function hasPrevSibling ( ConnectionInterface $ con = null ) { if ( ! ChildCategoryQuery :: isValid ( $ this ) ) { return false ; } return ChildCategoryQuery :: create ( ) -> filterByTreeRight ( $ this -> getLeftValue ( ) - 1 ) -> exists ( $ con ) ; }
Determines if the node has previous sibling
231,702
public function getPrevSibling ( ConnectionInterface $ con = null ) { return ChildCategoryQuery :: create ( ) -> filterByTreeRight ( $ this -> getLeftValue ( ) - 1 ) -> findOne ( $ con ) ; }
Gets previous sibling for the given node if it exists
231,703
public function hasNextSibling ( ConnectionInterface $ con = null ) { if ( ! ChildCategoryQuery :: isValid ( $ this ) ) { return false ; } return ChildCategoryQuery :: create ( ) -> filterByTreeLeft ( $ this -> getRightValue ( ) + 1 ) -> exists ( $ con ) ; }
Determines if the node has next sibling
231,704
public function getNextSibling ( ConnectionInterface $ con = null ) { return ChildCategoryQuery :: create ( ) -> filterByTreeLeft ( $ this -> getRightValue ( ) + 1 ) -> findOne ( $ con ) ; }
Gets next sibling for the given node if it exists
231,705
public function getChildren ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( null === $ this -> collNestedSetChildren || null !== $ criteria ) { if ( $ this -> isLeaf ( ) || ( $ this -> isNew ( ) && null === $ this -> collNestedSetChildren ) ) { $ this -> initNestedSetChildren ( ) ; } else { $ c...
Gets the children of the given node
231,706
public function countChildren ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( null === $ this -> collNestedSetChildren || null !== $ criteria ) { if ( $ this -> isLeaf ( ) || ( $ this -> isNew ( ) && null === $ this -> collNestedSetChildren ) ) { return 0 ; } else { return ChildCategoryQuery ::...
Gets number of children for the given node
231,707
public function getFirstChild ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( $ this -> isLeaf ( ) ) { return null ; } else { return ChildCategoryQuery :: create ( null , $ criteria ) -> childrenOf ( $ this ) -> orderByBranch ( ) -> findOne ( $ con ) ; } }
Gets the first child of the given node
231,708
public function getSiblings ( $ includeNode = false , Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( $ this -> isRoot ( ) ) { return array ( ) ; } else { $ query = ChildCategoryQuery :: create ( null , $ criteria ) -> childrenOf ( $ this -> getParent ( $ con ) ) -> orderByBranch ( ) ; if ( ! $ i...
Gets the siblings of the given node
231,709
public function getDescendants ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( $ this -> isLeaf ( ) ) { return array ( ) ; } else { return ChildCategoryQuery :: create ( null , $ criteria ) -> descendantsOf ( $ this ) -> orderByBranch ( ) -> find ( $ con ) ; } }
Gets descendants for the given node
231,710
public function countDescendants ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( $ this -> isLeaf ( ) ) { return 0 ; } else { return ChildCategoryQuery :: create ( null , $ criteria ) -> descendantsOf ( $ this ) -> count ( $ con ) ; } }
Gets number of descendants for the given node
231,711
public function getBranch ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { return ChildCategoryQuery :: create ( null , $ criteria ) -> branchOf ( $ this ) -> orderByBranch ( ) -> find ( $ con ) ; }
Gets descendants for the given node plus the current node
231,712
public function getAncestors ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { if ( $ this -> isRoot ( ) ) { return array ( ) ; } else { return ChildCategoryQuery :: create ( null , $ criteria ) -> ancestorsOf ( $ this ) -> orderByBranch ( ) -> find ( $ con ) ; } }
Gets ancestors for the given node starting with the root node Use it for breadcrumb paths for instance
231,713
protected function assignOriginalArguments ( ) { $ originalRequest = $ this -> request -> getOriginalRequest ( ) ; if ( ! empty ( $ originalRequest ) ) { $ originalArguments = $ originalRequest -> getArguments ( ) ; $ this -> view -> assign ( 'originalArguments' , $ originalArguments ) ; } }
Assigns the arguments from the original request .
231,714
public function setDescription ( $ text , $ length = 80 ) { $ description = array ( ) ; $ split = str_split ( $ text , $ length ) ; array_walk ( $ split , function ( $ value ) use ( & $ description ) { $ description [ ] = $ value ; } ) ; $ this -> description = $ description ; return $ this ; }
Set description at top of docblock
231,715
public function addVar ( $ name , $ type = '' , $ description = '' ) { $ this -> var_types [ $ name ] = $ type == '' ? $ type : $ type . ' ' ; $ this -> var_descriptions [ $ name ] = $ description ; return $ this ; }
Add a var on a docblock
231,716
public static function convertDate ( $ sourceFormat , $ targetFormat , $ value ) { $ dateObject = date_create_from_format ( $ sourceFormat , $ value ) ; if ( $ dateObject ) { return $ dateObject -> format ( $ targetFormat ) ; } else { return null ; } }
Convert a date from one format to another
231,717
public static function convertSecondsToElapsedTime ( $ seconds ) { $ hours = floor ( $ seconds / 3600 ) ; $ remainder = $ seconds - ( $ hours * 3600 ) ; $ minutes = floor ( $ remainder / 60 ) ; $ seconds = round ( $ remainder - ( $ minutes * 60 ) ) ; return sprintf ( "%02d" , $ hours ) . ":" . sprintf ( "%02d" , $ minu...
Convert seconds to an elapsed time value
231,718
protected function getCurrentInstance ( ) { $ instance = $ this -> getRequest ( ) -> getSession ( ) -> get ( 'instance' ) ; if ( $ instance ) { $ instance = $ this -> getManager ( ) -> find ( $ instance -> getId ( ) ) ; } return $ instance ; }
Get the current instance if exists
231,719
protected function getWorker ( ) { $ instance = $ this -> getCurrentInstance ( ) ; if ( $ instance ) { $ worker = $ this -> get ( 'ringo_php_redmon.instance_worker' ) -> setInstance ( $ instance ) ; if ( $ worker -> ping ( ) ) { return $ worker ; } $ this -> getRequest ( ) -> getSession ( ) -> set ( 'instance' , null )...
Get instance worker initialized with current instance
231,720
public function getConfig ( $ refresh = false ) { return $ this -> getCache ( 'plugins-config' , $ refresh , function ( ) { return [ 'wei' => [ 'aliases' => $ this -> getWeiAliases ( ) , ] , 'app' => [ 'controllerMap' => $ this -> getAppControllerMap ( ) , ] , 'plugin' => [ 'pluginClasses' => $ this -> getPluginClasses...
Receive plugin relatives service configs
231,721
protected function getPluginClasses ( $ refresh = false ) { if ( $ refresh || ! $ this -> pluginClasses ) { $ this -> pluginClasses = [ ] ; $ files = $ this -> globByDirs ( $ this -> dirs , '/Plugin.php' ) ; foreach ( $ files as $ file ) { $ class = $ this -> guessClassName ( $ file ) ; $ name = explode ( '\\' , $ clas...
Get all plugin classes
231,722
public function parseResource ( $ resource ) { $ pluginId = $ file = null ; if ( isset ( $ resource [ 0 ] ) && $ resource [ 0 ] == '@' ) { list ( $ pluginId , $ file ) = explode ( '/' , $ resource , 2 ) ; $ pluginId = substr ( $ pluginId , 1 ) ; } if ( strpos ( $ resource , ':' ) !== false ) { wei ( ) -> logger -> warn...
Parse a resource and return the components contains path and file
231,723
public function install ( $ id ) { $ plugin = $ this -> getById ( $ id ) ; if ( ! $ plugin ) { return [ 'code' => - 1 , 'message' => 'Plugin not found' ] ; } if ( $ this -> isInstalled ( $ id ) ) { return [ 'code' => - 2 , 'message' => 'Plugin has been installed' ] ; } $ ret = $ plugin -> install ( ) ; if ( $ ret [ 'co...
Install a plugin by ID
231,724
public function uninstall ( $ id ) { $ plugin = $ this -> getById ( $ id ) ; if ( ! $ plugin ) { return [ 'code' => - 3 , 'message' => 'Plugin not found' ] ; } if ( ! $ this -> isInstalled ( $ id ) ) { return [ 'code' => - 4 , 'message' => 'Plugin not installed' ] ; } if ( $ this -> isBuildIn ( $ id ) ) { return [ 'cod...
Uninstall a plugin by ID
231,725
protected function getPluginClass ( $ id ) { return isset ( $ this -> pluginClasses [ $ id ] ) ? $ this -> pluginClasses [ $ id ] : null ; }
Returns the plugin class by plugin ID
231,726
protected function getEventsById ( $ id ) { $ events = [ ] ; $ methods = get_class_methods ( $ this -> getPluginClass ( $ id ) ) ; foreach ( $ methods as $ method ) { if ( substr ( $ method , 0 , 2 ) != 'on' ) { continue ; } $ event = lcfirst ( substr ( $ method , 2 ) ) ; if ( is_numeric ( substr ( $ event , - 1 ) ) ) ...
Returns the event definitions by plugin ID
231,727
public function loadEvent ( $ name ) { if ( isset ( $ this -> loadedEvents [ $ name ] ) ) { return ; } $ this -> loadedEvents [ $ name ] = true ; $ events = $ this -> getEvents ( ) ; if ( ! isset ( $ events [ $ name ] ) ) { return ; } $ baseMethod = 'on' . ucfirst ( $ name ) ; foreach ( $ events [ $ name ] as $ priorit...
Load plugin event by name
231,728
public function generateClassMap ( array $ dirs , $ pattern , $ type , $ ignoreProject = true ) { $ patterns = ( array ) $ pattern ; $ types = ( array ) $ type ; $ map = [ ] ; foreach ( $ patterns as $ i => $ pattern ) { $ files = $ this -> globByDirs ( $ dirs , $ pattern ) ; foreach ( $ files as $ file ) { $ class = $...
Generate class map
231,729
protected function guessClassName ( $ file , $ ignoreProject = false ) { if ( $ file [ 0 ] === '.' ) { $ file = '\\' . ltrim ( $ file , './' ) ; } list ( $ dir , $ className ) = explode ( 'src/' , $ file ) ; if ( $ dir == '\\' ) { $ dir = '' ; } $ composerJson = ( $ dir ? ( $ dir . '/' ) : '' ) . 'composer.json' ; if (...
Guest class name by file name
231,730
protected function getShortName ( $ class , $ type ) { $ name = explode ( '\\' . $ type . '\\' , $ class , 2 ) [ 1 ] ; $ pos = strrpos ( $ name , '\\' ) ; $ pos = $ pos === false ? 0 : $ pos + 1 ; $ name [ $ pos ] = lcfirst ( $ name [ $ pos ] ) ; $ name = lcfirst ( $ name ) ; return $ name ; }
Return short name of class by specified type
231,731
protected function globByDirs ( array $ dirs , $ pattern ) { $ dirs = implode ( ',' , $ dirs ) ; $ pattern = '{' . $ dirs . '}' . $ pattern ; return glob ( $ pattern , GLOB_BRACE | GLOB_NOSORT ) ; }
Find files matching a pattern in specified directories
231,732
protected function setInstalledIds ( array $ pluginIds ) { $ app = $ this -> app -> getRecord ( ) ; $ app [ 'pluginIds' ] = array_filter ( $ pluginIds ) ; $ app -> save ( ) ; return $ this ; }
Stores installed plugin IDs
231,733
final protected function fclose ( ) { $ this -> _fhandle = null ; $ this -> flocked = false ; $ this -> use_include_path = false ; }
Closes file . Only resets class variables
231,734
public function filesize ( ) { if ( $ this -> use_include_path ) { return filesize ( stream_resolve_include_path ( $ this -> _fhandle ) ) ; } else { return filesize ( $ this -> _fhandle ) ; } }
Gets file size
231,735
public function fileinode ( ) { if ( $ this -> use_include_path ) { return fileinode ( stream_resolve_include_path ( $ this -> _fhandle ) ) ; } else { return fileinode ( $ this -> _fhandle ) ; } }
Gets file inode
231,736
public function fileatime ( ) { if ( $ this -> use_include_path ) { return fileatime ( stream_resolve_include_path ( $ this -> _fhandle ) ) ; } else { return fileatime ( $ this -> _fhandle ) ; } }
Gets last access time of file
231,737
public function filectime ( ) { if ( $ this -> use_include_path ) { return filectime ( stream_resolve_include_path ( $ this -> _fhandle ) ) ; } else { return filectime ( $ this -> _fhandle ) ; } }
Gets inode change time of file
231,738
public function filemtime ( ) { if ( $ this -> use_include_path ) { return filemtime ( stream_resolve_include_path ( $ this -> _fhandle ) ) ; } else { return filemtime ( $ this -> _fhandle ) ; } }
Gets file modification time
231,739
public function fileowner ( ) { if ( $ this -> use_include_path ) { return fileowner ( stream_resolve_include_path ( $ this -> _fhandle ) ) ; } else { return fileowner ( $ this -> _fhandle ) ; } }
Gets file owner
231,740
public function filegroup ( ) { if ( $ this -> use_include_path ) { return filegroup ( stream_resolve_include_path ( $ this -> _fhandle ) ) ; } else { return filegroup ( $ this -> _fhandle ) ; } }
Gets file group
231,741
public function fileperms ( ) { if ( $ this -> use_include_path ) { return fileperms ( stream_resolve_include_path ( $ this -> _fhandle ) ) ; } else { return fileperms ( $ this -> _fhandle ) ; } }
Gets file permissions
231,742
public function getTypeTitle ( ) { return isset ( self :: $ type_titles [ $ this -> type ] ) ? self :: $ type_titles [ $ this -> type ] : '' ; }
Get title for current type .
231,743
public function getParam ( string $ paramName ) { return $ this -> hasParam ( $ paramName ) ? $ this -> params [ $ paramName ] : null ; }
Get parameter from request
231,744
public function setParam ( string $ paramName , $ paramValue ) : HttpRequestContract { $ this -> params [ $ paramName ] = $ paramValue ; return $ this ; }
Set parameter in request
231,745
function setArray ( array $ options ) { foreach ( $ options as $ key => $ value ) { $ this -> set ( $ key , $ value ) ; } return $ this ; }
Multiple set options .
231,746
function run ( callable $ callback = null ) { if ( isset ( $ this -> res ) ) return null ; $ this -> res = proc_open ( $ this -> cmd , $ this -> descriptor_spec , $ this -> pipes , $ this -> cwd , $ this -> env ) ; if ( $ this -> res ) { $ this -> stdout = new TcpConnection ( $ this -> pipes [ 1 ] ) ; if ( is_callable ...
Execute command in a child process .
231,747
function send ( $ data , $ length = null ) { if ( ! isset ( $ this -> pipes [ 0 ] ) ) return 0 ; if ( ! isset ( $ length ) ) $ length = strlen ( $ data ) ; return intval ( fwrite ( $ this -> pipes [ 0 ] , $ data , $ length ) ) ; }
Write data to stdin pipe .
231,748
function close ( ) { if ( isset ( $ this -> res ) ) { $ this -> stdout -> close ( ) ; fclose ( $ this -> pipes [ 0 ] ) ; $ status = $ this -> status ( ) ; $ exit = $ status [ 'running' ] ? proc_close ( $ this -> res ) : $ status [ 'exitcode' ] ; unset ( $ this -> res , $ this -> pipes , $ this -> stdout ) ; return $ ex...
Terminate process .
231,749
public function validateAsArray ( $ bool = null ) { if ( false === is_bool ( $ bool ) && null !== $ bool ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type boolean, "%s" given' , __METHOD__ , gettype ( $ bool ) ) , E_USER_ERROR ) ; } if ( null === $ bool ) { $ bool = true ; } foreach ( ...
Set a rule that a field value must be an array and all array items will be validated individual
231,750
public function combine ( ) { $ fieldnames = func_get_args ( ) ; $ values = [ ] ; foreach ( $ fieldnames as $ fieldname ) { if ( false === is_string ( $ fieldname ) ) { return trigger_error ( sprintf ( 'All fieldnames used in "%s"() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ fieldname ) ) , E_US...
Combines multiple fields to be as one for validation
231,751
public function token ( ) { $ session = new Session ( ) ; $ name = $ this -> getValue ( '_token-name' ) ; $ value = $ this -> getValue ( '_token-value' ) ; if ( ( null !== $ name && null !== $ value && $ session -> pull ( [ '_token' , $ name ] ) !== $ value ) || null === $ name || null === $ value ) { $ instance = $ th...
Validates token from input
231,752
private function getMessageInstance ( ) { if ( null === $ this -> messageInstance ) { $ this -> messageInstance = Message :: Instance ( ) ; } return $ this -> messageInstance ; }
Returns the instance for custom messsages
231,753
private function isRequired ( $ field , $ value ) { if ( true === isset ( $ this -> required [ $ field ] ) ) { $ empty = true ; if ( true === is_array ( $ value ) ) { foreach ( $ value as $ val ) { if ( strlen ( trim ( $ val ) ) > 0 ) { $ empty = false ; } } } if ( true === is_string ( $ value ) && strlen ( trim ( $ va...
Evaluates if field value is required or not
231,754
private function isValidateArray ( $ field ) { if ( true === isset ( $ this -> validateAsArray [ $ field ] ) ) { return $ this -> validateAsArray [ $ field ] ; } return false ; }
Evaluates if field value should be validated as an array
231,755
private function getRuleClass ( $ rule ) { if ( false === is_string ( $ rule ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ rule ) ) , E_USER_ERROR ) ; } if ( true === isset ( $ this -> custom [ $ rule ] ) ) { return $ this -> custom ...
Returns the class of the rule
231,756
private function setErrorMessage ( $ rule , $ class ) { $ instance = $ this -> getMessageInstance ( ) ; $ message = $ instance :: getMessage ( $ rule -> field , $ rule -> rule ) ; $ message = null !== $ message ? $ message : $ class -> getMessage ( ) ; $ message = Translation :: translate ( $ message , $ rule -> parame...
Set the error message for particular rule
231,757
private function getValue ( $ field , $ prefix = null ) { foreach ( $ this -> combine as $ combine ) { if ( $ combine -> getName ( ) === $ field ) { return $ combine -> combine ( ) ; } } if ( null !== $ prefix ) { $ field = $ prefix . '[' . $ field . ']' ; } $ helper = new StringToArray ( ) ; $ data = $ helper -> execu...
Returns the value for a given field
231,758
public function resetParts ( array $ partNames = array ( ) ) { if ( empty ( $ partNames ) ) { $ partNames = array_keys ( $ this -> parts ) ; } foreach ( $ partNames as $ partName ) { $ this -> resetPart ( $ partName ) ; } return $ this ; }
Resets query parts .
231,759
public function resetPart ( $ partName ) { $ this -> parts [ $ partName ] = is_array ( $ this -> parts [ $ partName ] ) ? array ( ) : null ; return $ this ; }
Resets a query part .
231,760
public function select ( $ selects = array ( ) ) { $ this -> type = self :: SELECT ; if ( ! empty ( $ selects ) ) { $ this -> parts [ 'select' ] = array_merge ( $ this -> parts [ 'select' ] , ( array ) $ selects ) ; } return $ this ; }
Sets the select query mode .
231,761
public function insert ( $ insert ) { $ this -> type = self :: INSERT ; $ this -> from ( $ insert ) ; return $ this ; }
Sets the insert query mode for a specific table .
231,762
public function update ( $ update , $ alias = null ) { $ this -> type = self :: UPDATE ; $ this -> from ( $ update , $ alias ) ; return $ this ; }
Sets the update query mode for a specific table .
231,763
public function delete ( $ delete , $ alias = null ) { $ this -> type = self :: DELETE ; $ this -> from ( $ delete , $ alias ) ; return $ this ; }
Sets the delete query mode for a specific table .
231,764
public function innerJoin ( $ fromAlias , $ join , $ alias , $ condition = null ) { return $ this -> join ( $ fromAlias , 'inner' , $ join , $ alias , $ condition ) ; }
Adds an INNER JOIN clause to the query .
231,765
public function rightJoin ( $ fromAlias , $ join , $ alias , $ condition = null ) { return $ this -> join ( $ fromAlias , 'right' , $ join , $ alias , $ condition ) ; }
Adds a RIGHT JOIN clause to the query .
231,766
public function where ( $ expression , $ type = Expression \ Expression :: TYPE_AND ) { return $ this -> addExpression ( 'where' , $ type , $ expression ) ; }
Adds a WHERE clause to the query .
231,767
public function having ( $ expression , $ type = Expression \ Expression :: TYPE_AND ) { return $ this -> addExpression ( 'having' , $ type , $ expression ) ; }
Adds an HAVING clause to the query .
231,768
public function setParameters ( array $ parameters , array $ types = array ( ) ) { foreach ( $ parameters as $ parameter => $ value ) { if ( isset ( $ types [ $ parameter ] ) ) { $ this -> setParameter ( $ parameter , $ value , $ types [ $ parameter ] ) ; } else { $ this -> setParameter ( $ parameter , $ value ) ; } } ...
Sets query parameters .
231,769
public function createParameter ( $ value , $ type = null ) { if ( $ this -> mode === self :: MODE_POSITIONAL ) { return $ this -> createPositionalParameter ( $ value , $ type ) ; } return $ this -> createNamedParameter ( $ value , $ type ) ; }
Creates and sets a parameter .
231,770
public function createPositionalParameter ( $ value , $ type = null ) { $ this -> setParameter ( $ this -> parameterCounters [ 'positional' ] , $ value , $ type ) ; return '?' ; }
Creates and sets a positional parameter .
231,771
public function createNamedParameter ( $ value , $ type = null , $ placeholder = null ) { if ( $ placeholder === null ) { $ placeholder = ':fridge' ; } $ parameter = substr ( $ placeholder , 1 ) ; if ( ! isset ( $ this -> parameterCounters [ 'named' ] [ $ parameter ] ) ) { $ this -> parameterCounters [ 'named' ] [ $ pa...
Creates and sets a named parameter .
231,772
public function getParameterType ( $ identifier ) { return isset ( $ this -> parameterTypes [ $ identifier ] ) ? $ this -> parameterTypes [ $ identifier ] : null ; }
Gets a query parameter type .
231,773
public function getQuery ( ) { $ query = null ; switch ( $ this -> type ) { case self :: SELECT : $ query = $ this -> getSelectQuery ( ) ; break ; case self :: INSERT : $ query = $ this -> getInsertQuery ( ) ; break ; case self :: UPDATE : $ query = $ this -> getUpdateQuery ( ) ; break ; case self :: DELETE : $ query =...
Gets the generated query .
231,774
private function addExpression ( $ part , $ type , $ expression ) { if ( ! ( $ expression instanceof Expression \ Expression ) ) { $ expression = new Expression \ Expression ( $ type , ( array ) $ expression ) ; } if ( $ this -> parts [ $ part ] === null ) { $ this -> parts [ $ part ] = $ expression ; return $ this ; }...
Adds an expression to the WHERE or HAVING clause .
231,775
private function getSelectQuery ( ) { return 'SELECT ' . ( empty ( $ this -> parts [ 'select' ] ) ? '*' : implode ( ', ' , $ this -> parts [ 'select' ] ) ) . ' FROM ' . $ this -> getFromClause ( ) . ( ( $ this -> parts [ 'where' ] !== null ) ? ' WHERE ' . $ this -> parts [ 'where' ] : null ) . ( ! empty ( $ this -> par...
Generates a SELECT query
231,776
private function getInsertQuery ( ) { return 'INSERT INTO ' . $ this -> parts [ 'from' ] [ 0 ] [ 'table' ] . ' (' . implode ( ', ' , array_keys ( $ this -> parts [ 'set' ] ) ) . ')' . ' VALUES' . ' (' . implode ( ', ' , $ this -> parts [ 'set' ] ) . ')' ; }
Generates an INSERT query .
231,777
private function getUpdateQuery ( ) { if ( isset ( $ this -> parts [ 'from' ] [ 0 ] [ 'alias' ] ) ) { $ fromClause = $ this -> parts [ 'from' ] [ 0 ] [ 'alias' ] . ' FROM ' . $ this -> getFromClause ( ) ; } else { $ fromClause = $ this -> parts [ 'from' ] [ 0 ] [ 'table' ] ; } $ setClause = array ( ) ; foreach ( $ this...
Generates an UPDATE query .
231,778
private function getDeleteQuery ( ) { $ fromClause = null ; if ( isset ( $ this -> parts [ 'from' ] [ 0 ] [ 'alias' ] ) ) { $ fromClause = $ this -> parts [ 'from' ] [ 0 ] [ 'alias' ] . ' ' ; } $ fromClause .= 'FROM ' . $ this -> getFromClause ( ) ; return 'DELETE ' . $ fromClause . ( ( $ this -> parts [ 'where' ] !== ...
Generates a DELETE query .
231,779
private function getFromClause ( ) { $ fromClauses = array ( ) ; foreach ( $ this -> parts [ 'from' ] as $ from ) { $ fromClause = $ from [ 'table' ] ; if ( $ from [ 'alias' ] !== null ) { $ fromClause .= ' ' . $ from [ 'alias' ] ; } if ( isset ( $ this -> parts [ 'join' ] [ $ from [ 'alias' ] ] ) ) { foreach ( $ this ...
Generates the FROM clause .
231,780
public static function cleanExtension ( ? string $ string ) : ? string { if ( ! self :: contains ( '.' , $ string ) ) { return $ string ; } $ splited = explode ( '.' , $ string ) ; array_pop ( $ splited ) ; return implode ( '.' , $ splited ) ; }
Remove extension from string
231,781
public static function upperCase ( ? string $ string = null ) : ? string { if ( $ string === null ) { return null ; } return mb_strtoupper ( $ string , 'UTF-8' ) ; }
Change content to upper case . Analog of strtoupper with UTF - 8
231,782
public static function splitCamelCase ( string $ string , string $ glue = ' ' ) : string { $ expression = '/(?#! splitCamelCase Rev:20140412) # Split camelCase "words". Two global alternatives. Either g1of2: (?<=[a-z]) # Position is after a lowercase, ...
Split camel case words with glue . camelCaseWords = > Camel case words
231,783
public static function concat ( ) { $ args = func_get_args ( ) ; $ separator = array_shift ( $ args ) ; $ output = null ; foreach ( $ args as $ string ) { $ output .= $ string . $ separator ; } $ output = rtrim ( $ output , $ separator ) ; return $ output ; }
Concat string with add string by separator
231,784
function btn ( $ label , $ tagbody ) { return $ this -> button ( $ label , null , $ tagbody ) -> set ( 'type' , null ) ; }
Same as button only it doenst submit data .
231,785
function errors ( $ fieldname ) { if ( $ fieldname == null ) { return null ; } else { if ( $ this -> errors !== null ) { if ( isset ( $ this -> errors [ $ fieldname ] ) ) { return $ this -> errors [ $ fieldname ] ; } else { return null ; } } } }
Retrieves errors for a given field or all errors if no field is specified .
231,786
function addfieldconfigurer ( callable $ configurer , $ fieldtypes = null ) { $ fieldtypes != null or $ fieldtypes = 'field' ; is_array ( $ fieldtypes ) or $ fieldtypes = [ $ fieldtypes ] ; foreach ( $ fieldtypes as $ fieldtype ) { $ this -> fieldconfigurers [ $ fieldtype ] = $ configurer ; } return $ this ; }
Adds a configurer to the field . The configurer is called by the fields during rendering . The configurer is primarily used for formatting .
231,787
public function aroundGetNotLoggedInGroup ( \ Magento \ Customer \ Model \ GroupManagement $ subject , \ Closure $ proceed ) { $ result = $ proceed ( ) ; $ code = $ this -> hlpReferral -> getReferralCode ( ) ; if ( $ code ) { $ groupId = $ this -> hlpConfig -> getReferralsGroupReferrals ( ) ; $ result = $ this -> daoCu...
Get referral group data instead of anonymous group .
231,788
public static function add ( $ key , $ value ) { if ( null === $ value && is_array ( $ key ) ) { foreach ( $ key as $ index => $ value ) { static :: $ data [ $ index ] = $ value ; } return ; } if ( true === isset ( static :: $ data [ $ key ] ) && true === is_array ( static :: $ data [ $ key ] ) ) { if ( true === is_arr...
Stores a new piece of data and tries to merge the data if already exists
231,789
public static function set ( $ key , $ value ) { if ( false === is_string ( $ key ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ key ) ) , E_USER_ERROR ) ; } static :: $ data [ $ key ] = $ value ; }
Stores a new piece of data and overwrites the data if already exists
231,790
public static function remove ( $ key ) { if ( false === is_string ( $ key ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ key ) ) , E_USER_ERROR ) ; } if ( $ key && isset ( static :: $ data [ $ key ] ) ) { unset ( static :: $ data [ $...
Remove data based on key
231,791
public function set ( $ number ) { $ this -> setCurrentValue ( $ number ) ; $ this -> currentOperation = 'add' ; $ this -> addToHistory ( 'set' , $ number ) ; return $ this ; }
Sets the current value .
231,792
protected function performOperationOnExpressionEngine ( $ operation , $ number ) { $ this -> currentOperation = $ operation ; if ( is_array ( $ number ) ) { foreach ( $ number as $ actualNumber ) { $ this -> { $ operation } ( $ actualNumber ) ; } } else { $ this -> addToHistory ( $ operation , $ number ) ; $ this -> se...
Helper function to recursively call a method on the FluentCalculator and the underlying expression engine .
231,793
public function add ( $ number = null ) { if ( $ number == null ) { $ this -> internalSetOperationModeWithHistory ( 'add' ) ; } elseif ( $ number instanceof Closure ) { $ this -> internalSetOperationModeWithHistory ( 'add' ) ; return $ this -> group ( $ number ) ; } else { $ this -> performOperationOnExpressionEngine (...
Adds a given number to the current value .
231,794
public function subtract ( $ number = null ) { if ( $ number == null ) { $ this -> internalSetOperationModeWithHistory ( 'subtract' ) ; } elseif ( $ number instanceof Closure ) { $ this -> internalSetOperationModeWithHistory ( 'subtract' ) ; return $ this -> group ( $ number ) ; } else { $ this -> performOperationOnExp...
Subtracts a given number from the current value .
231,795
public function multiply ( $ number = null ) { if ( $ number === null ) { $ this -> internalSetOperationModeWithHistory ( 'multiply' ) ; } elseif ( $ number instanceof Closure ) { $ this -> internalSetOperationModeWithHistory ( 'multiply' ) ; return $ this -> group ( $ number ) ; } else { $ this -> performOperationOnEx...
Multiplies the current value by a given number .
231,796
public function divide ( $ number = null ) { if ( $ number === null ) { $ this -> internalSetOperationModeWithHistory ( 'divide' ) ; } elseif ( $ number instanceof Closure ) { $ this -> internalSetOperationModeWithHistory ( 'divide' ) ; return $ this -> group ( $ number ) ; } else { $ this -> performOperationOnExpressi...
Divides the current value by a given number .
231,797
public function round ( $ number , $ precision = 0 , $ mode = PHP_ROUND_HALF_UP ) { return $ this -> runExpressionFunction3Param ( 'round' , $ number , $ precision , $ mode ) ; }
Rounds a number to the nearest value .
231,798
public function evaluate ( ) { $ path = $ this -> getPath ( ) ; if ( $ path === null ) { throw new FusionException ( '"path" was not specified' , 1386458763 ) ; } $ package = $ this -> getPackage ( ) ; if ( $ package === null ) { $ controllerContext = $ this -> runtime -> getControllerContext ( ) ; $ actionRequest = $ ...
Returns the absolute URL of a resource with cache bursting string
231,799
protected function getPropertyFilepaths ( ) { $ file = $ this -> basename . '.properties' ; if ( $ this -> MessageService -> fileExists ( $ file ) ) return $ this -> MessageService -> resolveFile ( $ file ) -> getLocalPath ( ) ; return null ; }
Get a list of reverse - specific absolute property file paths