idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
6,700
public static function copy ( $ names , $ from , & $ to ) { if ( is_array ( $ from ) && is_array ( $ to ) ) { foreach ( $ names as $ key ) { if ( isset ( $ from [ $ key ] ) && ! isset ( $ to [ $ key ] ) ) { $ to [ $ key ] = static :: getValue ( $ from , $ key ) ; } } } return $ to ; }
Copies the values from one option array to another .
6,701
public static function move ( $ names , & $ from , & $ to ) { if ( is_array ( $ from ) && is_array ( $ to ) ) { foreach ( $ names as $ key ) { if ( isset ( $ from [ $ key ] ) && ! isset ( $ to [ $ key ] ) ) { $ to [ $ key ] = static :: getValue ( $ from , $ key ) ; $ moved [ $ key ] = static :: removeValue ( $ from , $...
Moves the item values from one array to another .
6,702
public static function addValue ( $ key , $ value , & $ array , $ glue = ' ' ) { if ( isset ( $ array [ $ key ] ) ) { if ( ! is_array ( $ array [ $ key ] ) ) $ array [ $ key ] = explode ( $ glue , $ array [ $ key ] ) ; $ array [ $ key ] [ ] = $ value ; $ array [ $ key ] = array_unique ( $ array [ $ key ] ) ; $ array [ ...
Adds a new option to the given array . If the key does not exists it will create one if it exists it will append the value and also makes sure the uniqueness of them .
6,703
public static function getValue ( $ array , $ key , $ default = null ) { if ( $ key instanceof \ Closure ) { return $ key ( $ array , $ default ) ; } elseif ( is_array ( $ array ) ) { return isset ( $ array [ $ key ] ) || array_key_exists ( $ key , $ array ) ? $ array [ $ key ] : $ default ; } else { return $ array -> ...
Retrieves the value of an array element or object property with the given key or property name . If the key does not exist in the array the default value will be returned instead .
6,704
public static function removeValue ( & $ array , $ key , $ default = null ) { if ( is_array ( $ array ) ) { $ value = static :: getValue ( $ array , $ key , $ default ) ; unset ( $ array [ $ key ] ) ; return static :: value ( $ value ) ; } return self :: value ( $ default ) ; }
Removes an item from the given options and returns the value .
6,705
private function addLogs ( ) { $ createdBy = new GeneratorField ( ) ; $ createdBy -> name = 'created_by' ; $ createdBy -> parseDBType ( 'integer' ) ; $ createdBy -> parseOptions ( 'if,n' ) ; $ this -> fields [ ] = $ createdBy ; $ updatedBy = new GeneratorField ( ) ; $ updatedBy -> name = 'updated_by' ; $ updatedBy -> p...
added by dandisy
6,706
public function output ( $ flags = 0x00003 ) { if ( ( $ flags & self :: OUTPUT_HEADER ) == self :: OUTPUT_HEADER ) { $ this -> sendHeaders ( ) ; } if ( $ this -> outputClosure instanceof \ Closure ) { $ c = $ this -> outputClosure ; $ c ( ) ; return ; } if ( ( $ flags & self :: OUTPUT_BODY ) == self :: OUTPUT_BODY ) { ...
Sendet die Headers und gibt den Body aus
6,707
public function finishView ( FormView $ view , FormInterface $ form , array $ options ) { $ data = $ form -> getData ( ) ; if ( $ data instanceof InsertPagePagePart ) { $ this -> validateParentPage ( ) ; $ reflections = [ ] ; $ nodeFormView = $ view -> children [ 'node' ] ; foreach ( $ nodeFormView -> vars [ 'choices' ...
We want to set disable the parent page to prevent infinity insert cycle . If it is an edit page we can disable this from form s data .
6,708
protected function validateParentPage ( ) { $ request = $ this -> requestStack -> getMasterRequest ( ) ; if ( $ request -> query -> has ( 'pageid' ) && $ request -> query -> has ( 'pageclassname' ) ) { $ repo = $ this -> doctrine -> getManager ( ) -> getRepository ( 'KunstmaanNodeBundle:Node' ) ; $ node = $ repo -> get...
Check if the page part is insertable into the current page .
6,709
public function repos ( $ language = null , $ private = null , $ organization = null , $ type = null , $ imported = null ) { return $ this -> request ( sprintf ( 'github?lang=%s&private=%b&org_name=%s&org_type=%s&page=%d&only_imported=%b' , $ language , $ private , $ organization , $ type , 1 , $ imported ) ) ; }
lists your s github repos .
6,710
public function import ( $ repository , $ branch = null , $ file = null ) { return $ this -> request ( sprintf ( 'github/%s?branch=%s&file=%s' , $ this -> transform ( $ repository ) , $ branch , $ file ) , 'POST' ) ; }
imports project file from github .
6,711
public function getClassFromUse ( $ coverClassName , $ usedClasses ) { if ( false === is_array ( $ usedClasses ) ) { return $ coverClassName ; } foreach ( $ usedClasses as $ use ) { $ this -> getClassNameFromClassFQN ( $ use ) ; if ( $ coverClassName === $ this -> getClassNameFromClassFQN ( $ use ) ) { return $ use ; }...
check for className in use statements return className on missing use statement
6,712
public function getUsedClassesInClass ( $ classFile ) { $ useResult = array ( ) ; $ content = $ this -> getFileContent ( $ classFile ) ; if ( preg_match_all ( '/(use\s+)(.*)(;)/' , $ content , $ useResult ) && 4 === count ( $ useResult ) ) { return ( $ useResult [ 2 ] ) ; } return null ; }
return all in file use statement defined classes
6,713
public function set ( string $ hash , string $ content ) : void { $ this -> saveContent ( $ hash , $ content ) ; }
Sets content into the registry .
6,714
public static function create ( $ host , $ port , $ password ) { $ connection = ConnectionFactory :: create ( $ host , $ port , $ password ) ; return new Messenger ( $ connection ) ; }
Create a new RconMessenger
6,715
public function get ( $ name , $ default = null , $ file = null ) { $ configVal = null ; if ( is_array ( $ this -> config ) ) { if ( $ file === null ) { if ( count ( array_column ( $ this -> config , $ name ) ) > 0 ) { $ configVal = array_column ( $ this -> config , $ name ) [ 0 ] ; } else { $ configVal = array_column ...
Gets a config value from the config array .
6,716
public function getCMSFields ( ) { $ fields = parent :: getCMSFields ( ) ; $ fields -> removeByName ( 'Sort' ) ; $ fields -> removeByName ( 'ParentID' ) ; $ fields -> addFieldToTab ( 'Root.Main' , new TextField ( 'Name' , _t ( 'ExternalContentSource.NAME' , 'Name' ) ) ) ; $ fields -> addFieldToTab ( 'Root.Main' , new C...
Child classes should provide connection details to the external content source
6,717
public function stageChildren ( $ showAll = false ) { if ( ! $ this -> ID ) { return DataObject :: get ( 'ExternalContentSource' ) ; } $ children = new ArrayList ( ) ; return $ children ; }
Override to return the top level content items from the remote content source .
6,718
private static function core ( $ word , $ iteration ) { $ word = self :: rotate ( $ word ) ; for ( $ i = 0 ; $ i < 4 ; ++ $ i ) $ word [ $ i ] = self :: $ sbox [ $ word [ $ i ] ] ; $ word [ 0 ] = $ word [ 0 ] ^ self :: $ Rcon [ $ iteration ] ; return $ word ; }
Key Schedule Core
6,719
private static function createRoundKey ( $ expandedKey , $ roundKeyPointer ) { $ roundKey = array ( ) ; for ( $ i = 0 ; $ i < 4 ; $ i ++ ) for ( $ j = 0 ; $ j < 4 ; $ j ++ ) $ roundKey [ $ j * 4 + $ i ] = $ expandedKey [ $ roundKeyPointer + $ i * 4 + $ j ] ; return $ roundKey ; }
position within the expanded key .
6,720
private static function round ( $ state , $ roundKey ) { $ state = self :: subBytes ( $ state , false ) ; $ state = self :: shiftRows ( $ state , false ) ; $ state = self :: mixColumns ( $ state , false ) ; $ state = self :: addRoundKey ( $ state , $ roundKey ) ; return $ state ; }
applies the 4 operations of the forward round in sequence
6,721
private static function invRound ( $ state , $ roundKey ) { $ state = self :: shiftRows ( $ state , true ) ; $ state = self :: subBytes ( $ state , true ) ; $ state = self :: addRoundKey ( $ state , $ roundKey ) ; $ state = self :: mixColumns ( $ state , true ) ; return $ state ; }
applies the 4 operations of the inverse round in sequence
6,722
private static function encryptBlock ( $ input , $ key , $ size ) { $ output = array ( ) ; $ block = array ( ) ; $ nbrRounds = self :: numberOfRounds ( $ size ) ; for ( $ i = 0 ; $ i < 4 ; $ i ++ ) for ( $ j = 0 ; $ j < 4 ; $ j ++ ) $ block [ ( $ i + ( $ j * 4 ) ) ] = $ input [ ( $ i * 4 ) + $ j ] ; $ expandedKey = sel...
encrypts a 128 bit input block against the given key of size specified
6,723
private static function decryptBlock ( $ input , $ key , $ size ) { $ output = array ( ) ; $ block = array ( ) ; $ nbrRounds = self :: numberOfRounds ( $ size ) ; for ( $ i = 0 ; $ i < 4 ; $ i ++ ) for ( $ j = 0 ; $ j < 4 ; $ j ++ ) $ block [ ( $ i + ( $ j * 4 ) ) ] = $ input [ ( $ i * 4 ) + $ j ] ; $ expandedKey = sel...
decrypts a 128 bit input block against the given key of size specified
6,724
private static function getPaddedBlock ( $ bytesIn , $ start , $ end , $ mode ) { if ( $ end - $ start > 16 ) $ end = $ start + 16 ; $ xarray = array_slice ( $ bytesIn , $ start , $ end - $ start ) ; $ cpad = 16 - count ( $ xarray ) ; while ( count ( $ xarray ) < 16 ) { array_push ( $ xarray , $ cpad ) ; } return $ xar...
gets a properly padded block
6,725
public function refund ( $ guid , Amount $ refundAmount ) { return new Transaction ( $ this -> client -> post ( 'transactions/' . $ guid . '/refunds' , [ "amount" => $ refundAmount ] ) ) ; }
Refunds a previously initiated and closed and captured transaction .
6,726
protected function prepare_query ( ) { $ this -> query -> where ( $ this -> foreign_key , $ this -> local_model -> { $ this -> local_key } ) -> limit ( 1 ) ; }
Prepare the query object
6,727
public function hook ( $ event , callable $ callback , $ priority = 10 ) { $ this -> app -> hook ( $ event , $ callback , $ priority ) ; }
Hook an event
6,728
public function applyChain ( $ name , $ hookArg = null ) { $ hooks = $ this -> app -> getHooks ( ) ; if ( ! isset ( $ hooks [ $ name ] ) ) { $ hooks [ $ name ] = array ( array ( ) ) ; } if ( ! empty ( $ hooks [ $ name ] ) ) { if ( count ( $ hooks [ $ name ] ) > 1 ) { ksort ( $ hooks [ $ name ] ) ; } foreach ( $ hooks [...
Trigger a chained hook - The first callback to return a non - null value will be returned
6,729
public function actionClear ( ) { OAuth2AuthorizationCode :: deleteAll ( [ '<' , 'expires' , time ( ) ] ) ; OAuth2RefreshToken :: deleteAll ( [ '<' , 'expires' , time ( ) ] ) ; OAuth2AccessToken :: deleteAll ( [ '<' , 'expires' , time ( ) ] ) ; }
Clean up expired token
6,730
function UpdateCookies ( $ cookies ) { if ( sizeof ( $ this -> cookies ) == 0 ) { if ( sizeof ( $ cookies ) > 0 ) { $ this -> debug ( 'Setting new cookie(s)' ) ; $ this -> cookies = $ cookies ; } return TRUE ; } if ( sizeof ( $ cookies ) == 0 ) { return TRUE ; } foreach ( $ cookies as $ newCookie ) { if ( ! is_array ( ...
updates the current cookies with a new set
6,731
public function getNotifications ( ) { if ( $ this instanceof RESTUser ) { return $ this -> hasMany ( RESTDatabaseNotification :: class , [ 'notifiable_id' => 'id' ] ) -> onCondition ( [ 'notifiable_class' => self :: class ] ) -> addOrderBy ( [ 'created_at' => SORT_DESC ] ) ; } else { return $ this -> hasMany ( Databas...
Get the entity s notifications .
6,732
protected function arrayDot ( $ array , $ prepend = null ) { if ( function_exists ( 'array_dot' ) ) { return array_dot ( $ array ) ; } $ results = [ ] ; foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) ) { $ results = array_merge ( $ results , $ this -> arrayDot ( $ value , $ prepend . $ key . '.' ) ...
Flatten a multi - dimensional associative array with dots . From Laravel framework .
6,733
public function requireDefaultRecords ( ) { parent :: requireDefaultRecords ( ) ; if ( defined ( 'CREATE_GEODISTANCE_UDF' ) && GEOFORM_CREATE_GEODISTANCE_UDF ) { if ( ! defined ( 'CreateGeodistanceOnce' ) ) { define ( 'CreateGeodistanceOnce' , true ) ; $ q1 = "DROP FUNCTION IF EXISTS geodistance;" ; $ q2 = "CREATE FUNC...
Set Default Frontend group for new members
6,734
public function set ( array $ rules ) { $ this -> items = array_merge ( $ this -> items , $ this -> parseRules ( $ rules ) ) ; return $ this ; }
Set multiple rules .
6,735
protected function parseAttributeFilters ( array & $ parsedRules , $ attribute , $ filters ) { foreach ( explode ( '|' , $ filters ) as $ filter ) { $ parsedFilter = $ this -> parseRule ( $ filter ) ; if ( ! empty ( $ parsedFilter ) ) { $ parsedRules [ $ attribute ] [ ] = $ parsedFilter ; } } }
Parse attribute s filters .
6,736
private function registerJsonHandler ( Whoops $ whoops , $ config ) : void { if ( empty ( $ config [ 'json_exceptions' ] [ 'display' ] ) ) { return ; } $ handler = new JsonResponseHandler ( ) ; if ( ! empty ( $ config [ 'json_exceptions' ] [ 'show_trace' ] ) ) { $ handler -> addTraceToOutput ( true ) ; } if ( ! empty (...
If configuration indicates a JsonResponseHandler configure and register it .
6,737
public function hydrate ( array $ properties ) { foreach ( $ properties as $ prop => $ val ) { if ( property_exists ( $ this , $ prop ) ) { $ this -> { $ prop } = $ val ; } } return $ this ; }
Hydrate an entity with properites
6,738
public function from ( $ table , $ alias = null ) { $ this -> _table = ( string ) $ table ; $ this -> asAlias ( $ alias ) ; return $ this ; }
Set the table to join against .
6,739
public function on ( $ foreignKey , $ key = null ) { if ( is_array ( $ foreignKey ) ) { $ this -> _conditions = array_replace ( $ this -> _conditions , $ foreignKey ) ; } else { $ this -> _conditions [ $ foreignKey ] = $ key ; } return $ this ; }
Set the conditions to join on .
6,740
public function getViewHelperConfig ( ) { return [ 'aliases' => [ 'losrecaptcha/recaptcha' => Form \ View \ Helper \ Captcha \ ReCaptcha :: class , 'losrecaptcha/invisible' => Form \ View \ Helper \ Captcha \ Invisible :: class , ] , 'factories' => [ Form \ View \ Helper \ Captcha \ ReCaptcha :: class => InvokableFacto...
Return zend - view helper configuration .
6,741
public static function fromSchema ( $ schema , $ preFilter = array ( ) , $ postFilter = array ( ) ) { $ rules = array ( ) ; foreach ( $ preFilter as $ key => $ filter ) { $ filter = explode ( '|' , $ filter ) ; foreach ( $ filter as $ f ) { $ rules [ $ key ] [ ] = trim ( $ f ) ; } } foreach ( $ schema as $ k => $ field...
Static method to create instance of filter from database schema configuration .
6,742
public static function create ( $ modelAlias = null , $ criteria = null ) { if ( $ criteria instanceof RemoteHistoryContaoQuery ) { return $ criteria ; } $ query = new RemoteHistoryContaoQuery ( null , null , $ modelAlias ) ; if ( $ criteria instanceof Criteria ) { $ query -> mergeWith ( $ criteria ) ; } return $ query...
Returns a new RemoteHistoryContaoQuery object .
6,743
public function filterByRemoteAppId ( $ remoteAppId = null , $ comparison = null ) { if ( is_array ( $ remoteAppId ) ) { $ useMinMax = false ; if ( isset ( $ remoteAppId [ 'min' ] ) ) { $ this -> addUsingAlias ( RemoteHistoryContaoPeer :: REMOTE_APP_ID , $ remoteAppId [ 'min' ] , Criteria :: GREATER_EQUAL ) ; $ useMinM...
Filter the query on the remote_app_id column
6,744
public function filterByApiversion ( $ apiversion = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ apiversion ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ apiversion ) ) { $ apiversion = str_replace ( '*' , '%' , $ apiversion ) ; $ comparison = Criteria :...
Filter the query on the apiVersion column
6,745
public function filterByConfigDisplayerrors ( $ configDisplayerrors = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configDisplayerrors ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configDisplayerrors ) ) { $ configDisplayerrors = str_replace ( '*' , '%'...
Filter the query on the config_displayErrors column
6,746
public function filterByConfigBypasscache ( $ configBypasscache = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configBypasscache ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configBypasscache ) ) { $ configBypasscache = str_replace ( '*' , '%' , $ confi...
Filter the query on the config_bypassCache column
6,747
public function filterByConfigMinifymarkup ( $ configMinifymarkup = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configMinifymarkup ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configMinifymarkup ) ) { $ configMinifymarkup = str_replace ( '*' , '%' , $ ...
Filter the query on the config_minifyMarkup column
6,748
public function filterByConfigDebugmode ( $ configDebugmode = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configDebugmode ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configDebugmode ) ) { $ configDebugmode = str_replace ( '*' , '%' , $ configDebugmode...
Filter the query on the config_debugMode column
6,749
public function filterByConfigMaintenancemode ( $ configMaintenancemode = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configMaintenancemode ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configMaintenancemode ) ) { $ configMaintenancemode = str_replace (...
Filter the query on the config_maintenanceMode column
6,750
public function filterByConfigGzipscripts ( $ configGzipscripts = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configGzipscripts ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configGzipscripts ) ) { $ configGzipscripts = str_replace ( '*' , '%' , $ confi...
Filter the query on the config_gzipScripts column
6,751
public function filterByConfigRewriteurl ( $ configRewriteurl = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configRewriteurl ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configRewriteurl ) ) { $ configRewriteurl = str_replace ( '*' , '%' , $ configRewr...
Filter the query on the config_rewriteURL column
6,752
public function filterByConfigAdminemail ( $ configAdminemail = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configAdminemail ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configAdminemail ) ) { $ configAdminemail = str_replace ( '*' , '%' , $ configAdmi...
Filter the query on the config_adminEmail column
6,753
public function filterByConfigCachemode ( $ configCachemode = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ configCachemode ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ configCachemode ) ) { $ configCachemode = str_replace ( '*' , '%' , $ configCachemode...
Filter the query on the config_cacheMode column
6,754
public function filterByStatuscode ( $ statuscode = null , $ comparison = null ) { if ( is_array ( $ statuscode ) ) { $ useMinMax = false ; if ( isset ( $ statuscode [ 'min' ] ) ) { $ this -> addUsingAlias ( RemoteHistoryContaoPeer :: STATUSCODE , $ statuscode [ 'min' ] , Criteria :: GREATER_EQUAL ) ; $ useMinMax = tru...
Filter the query on the statuscode column
6,755
public function filterByExtensions ( $ extensions = null , $ comparison = null ) { if ( is_object ( $ extensions ) ) { $ extensions = serialize ( $ extensions ) ; } return $ this -> addUsingAlias ( RemoteHistoryContaoPeer :: EXTENSIONS , $ extensions , $ comparison ) ; }
Filter the query on the extensions column
6,756
public function filterByLog ( $ log = null , $ comparison = null ) { if ( is_object ( $ log ) ) { $ log = serialize ( $ log ) ; } return $ this -> addUsingAlias ( RemoteHistoryContaoPeer :: LOG , $ log , $ comparison ) ; }
Filter the query on the log column
6,757
public function filterByPHP ( $ pHP = null , $ comparison = null ) { if ( is_object ( $ pHP ) ) { $ pHP = serialize ( $ pHP ) ; } return $ this -> addUsingAlias ( RemoteHistoryContaoPeer :: PHP , $ pHP , $ comparison ) ; }
Filter the query on the php column
6,758
public function filterByMySQL ( $ mySQL = null , $ comparison = null ) { if ( is_object ( $ mySQL ) ) { $ mySQL = serialize ( $ mySQL ) ; } return $ this -> addUsingAlias ( RemoteHistoryContaoPeer :: MYSQL , $ mySQL , $ comparison ) ; }
Filter the query on the mysql column
6,759
public function useRemoteAppQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinRemoteApp ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'RemoteApp' , '\Slashworks\AppBundle\Model\RemoteAppQuery' ) ; }
Use the RemoteApp relation RemoteApp object
6,760
public function compare ( $ another ) { if ( $ another instanceof Collection ) { $ another = $ another -> toArray ( ) ; } $ me = $ this -> toArray ( ) ; if ( $ me == $ another ) { return 0 ; } else { return 1 ; } }
Perform comparison between this implementation and another implementation of \ Norm \ Type \ Collection or an array .
6,761
public function getWhereClause ( Builder $ objBuilder , $ blnProcessOnce = false ) { if ( $ blnProcessOnce && $ this -> blnProcessed ) { return null ; } $ this -> blnProcessed = true ; try { $ objConditionBuilder = new PartialBuilder ( $ objBuilder ) ; $ this -> updateQueryBuilder ( $ objConditionBuilder ) ; return $ o...
Used internally by QCubed Query to get an individual where clause for a given condition Mostly used for conditional joins .
6,762
public function buildForm ( FormBuilderInterface $ builder , array $ options ) { if ( $ this -> getParent ( ) === 'hidden' ) { $ builder -> addModelTransformer ( $ this -> transformer ) ; } }
add a data transformer if user can reach only one center
6,763
private function prepareReachableCenterByUser ( ) { $ groupCenters = $ this -> user -> getGroupCenters ( ) ; foreach ( $ groupCenters as $ groupCenter ) { $ center = $ groupCenter -> getCenter ( ) ; if ( ! array_key_exists ( $ center -> getId ( ) , $ this -> reachableCenters ) ) { $ this -> reachableCenters [ $ center ...
populate reachableCenters as an associative array where keys are center . id and value are center entities .
6,764
public function extractTo ( WebforgeDir $ dir = NULL ) { if ( ! isset ( $ dir ) ) $ dir = $ this -> rar -> getDirectory ( ) ; else $ dir -> create ( ) ; $ this -> exec ( 'x' , array ( 'y' ) , ( string ) $ dir ) ; return $ this ; }
Entpackt alle Dateien des Archives in ein Verzeichnis
6,765
function copy ( $ name , $ new_name , $ update = false ) { $ new_name = preg_replace ( '/([^a-zA-Z0-9_])/' , '_' , $ new_name ) ; $ result = array ( ) ; $ result [ 'status' ] = false ; if ( $ name && $ new_name ) { $ db = Factory :: getDBO ( ) ; $ query = $ db -> getQuery ( true ) -> select ( 'count(*)' ) -> from ( '#_...
handles copying JFusion plugins
6,766
function getManifest ( $ dir ) { $ file = $ dir . '/jfusion.xml' ; $ this -> installer -> setPath ( 'manifest' , $ file ) ; $ xml = JFusionFramework :: getXml ( $ file ) ; if ( ! ( $ xml instanceof SimpleXMLElement ) || ( $ xml -> getName ( ) != 'extension' ) ) { unset ( $ xml ) ; $ xml = null ; } else { $ type = $ thi...
load manifest file with installation information
6,767
function getFiles ( $ folder , $ name ) { $ filesArray = array ( ) ; $ files = Folder :: files ( $ folder , null , false , true ) ; $ path = JFusionFramework :: getPluginPath ( $ name ) ; foreach ( $ files as $ file ) { $ file = str_replace ( $ path . '/' , '' , $ file ) ; $ file = str_replace ( $ path . '\\' , '' , $ ...
get files function
6,768
public function addAssignment ( AssignmentElement $ element ) { $ element -> setContainer ( $ this ) ; $ this -> getAssignments ( ) -> attach ( $ element ) ; return $ this ; }
Add assignment to the markup .
6,769
public function getAssignmentsByName ( $ name ) { $ result = [ ] ; foreach ( $ this -> getAssignments ( ) as $ assignment ) { if ( $ assignment -> getName ( ) === $ name ) { $ result [ ] = $ assignment ; } } return $ result ; }
Return markup assignments list of a specific name .
6,770
public static function literal ( $ mixColValue ) { if ( is_null ( $ mixColValue ) ) { return 'null' ; } elseif ( is_integer ( $ mixColValue ) ) { return $ mixColValue ; } elseif ( is_bool ( $ mixColValue ) ) { return ( $ mixColValue ? 'true' : 'false' ) ; } elseif ( is_float ( $ mixColValue ) ) { return "(float)$mixCol...
Returns the string that will be used to represent the literal value given when codegenning a type table
6,771
private function writeFinalCheckResults ( CoverFishResult $ coverFishResult ) { if ( false === $ this -> scanFailure ) { $ this -> writeFileResult ( self :: FILE_PASS , null ) ; } else { $ this -> writeFileResult ( self :: FILE_FAILURE , $ coverFishResult -> getFailureStream ( ) ) ; } $ this -> jsonResults [ ] = $ this...
write single file check result
6,772
private function writeJsonFailureStream ( CoverFishResult $ coverFishResult , CoverFishPHPUnitTest $ unitTest , CoverFishMessageError $ mappingError , $ coverLine ) { $ this -> jsonResult [ 'errorCount' ] = $ coverFishResult -> getFailureCount ( ) ; $ this -> jsonResult [ 'errorMessage' ] = $ mappingError -> getMessage...
write single json error line
6,773
protected function getMacroLineInfo ( $ failureCount , CoverFishPHPUnitTest $ unitTest ) { $ lineInfoMacro = '%sError #%s in method "%s" (L:~%s)' ; if ( $ this -> outputLevel > 1 ) { $ lineInfoMacro = '%sError #%s in method "%s", Line ~%s' ; } return sprintf ( $ lineInfoMacro , $ this -> setIndent ( self :: MACRO_CONFI...
message block macro line 01 message title
6,774
protected function getMacroCoverErrorMessage ( CoverFishMessageError $ mappingError ) { $ lineMessageMacro = '%s%s: %s ' ; if ( $ this -> outputLevel > 1 ) { $ lineMessageMacro = '%s%s: %s (ErrorCode: %s)' ; } return sprintf ( $ lineMessageMacro , $ this -> setIndent ( self :: MACRO_CONFIG_DETAIL_LINE_INDENT ) , ( fals...
message block macro line 04 error message
6,775
public static function convertHashMap ( \ stdClass $ object , $ quote = self :: QUOTE_SINGLE ) { $ hash = '{' ; $ vars = get_object_vars ( $ object ) ; if ( count ( $ vars ) > 0 ) { foreach ( $ vars as $ key => $ value ) { $ hash .= sprintf ( '"%s": %s,' , $ key , self :: convertValue ( $ value , $ quote ) ) ; } $ hash...
Wandelt ein Object in ein Javascript Object - Literal um
6,776
public static function requireLoad ( Array $ requirements , Array $ alias , $ jsCode ) { return sprintf ( "requireLoad([%s], function (main%s) { // main is unshifted automatically\n %s\n});" , self :: buildRequirements ( $ requirements ) , count ( $ alias ) > 0 ? ', ' . implode ( ', ' , $ alias ) : '' , self :: conver...
This function loads inline script in blocking mode
6,777
public static function bootLoad ( Array $ requirements , $ alias = array ( ) , $ jsCode ) { return self :: requirejs ( 'boot' , 'boot' , sprintf ( "boot.getLoader().onRequire([%s], function (%s) {\n %s\n });" , self :: buildRequirements ( $ requirements ) , implode ( ', ' , $ alias ) , self :: convertJSCode ( $ jsC...
This function loads inline script in an HTML - page
6,778
protected function appendScopeChoices ( FormBuilderInterface $ builder , Role $ role , Center $ center , User $ user , AuthorizationHelper $ authorizationHelper , TranslatableStringHelper $ translatableStringHelper , ObjectManager $ om , $ name = 'scope' ) { $ reachableScopes = $ authorizationHelper -> getReachableScop...
Append a scope choice field with the scopes reachable by given user for the given role and center .
6,779
public function hasProfile ( $ profiles ) : bool { $ profiles = ( array ) $ profiles ; return count ( array_intersect ( $ this -> profiles -> pluck ( 'code' ) -> toArray ( ) , $ profiles ) ) > 0 ; }
Matches at least one user profile .
6,780
public function hasAllProfiles ( $ profiles ) : bool { $ profiles = ( array ) $ profiles ; return count ( array_intersect ( $ this -> profiles -> pluck ( 'code' ) -> toArray ( ) , $ profiles ) ) == count ( $ profiles ) ; }
Matches ALL user profiles .
6,781
public function assignProfiles ( $ profiles ) : void { $ profiles = ( array ) $ profiles ; foreach ( $ profiles as $ profile ) { $ electedProfile = Profile :: where ( 'code' , $ profile ) -> first ( ) ; if ( ! is_null ( $ electedProfile ) && ! $ this -> hasProfile ( $ profile ) ) { $ this -> assignRole ( Role :: find (...
Assigns profiles to the current model .
6,782
public function getContent ( string $ contentType = null ) : string { switch ( $ contentType ) { case 'application/vnd.transitive.document+json' : return $ this -> route -> getDocument ( ) ; break ; case 'application/vnd.transitive.document+xml' : return $ this -> route -> getDocument ( ) -> asXML ( 'document' ) ; brea...
Return processed content from current route .
6,783
protected function computeType ( ) { if ( interface_exists ( $ this -> class , false ) ) { $ this -> type = 'Interface' ; return ; } if ( trait_exists ( $ this -> class , false ) ) { $ this -> type = 'Trait' ; return ; } $ this -> type = 'Class' ; }
Determine the type of class
6,784
public static function doSelectOne ( Criteria $ criteria , PropelPDO $ con = null ) { $ critcopy = clone $ criteria ; $ critcopy -> setLimit ( 1 ) ; $ objects = ApiLogPeer :: doSelect ( $ critcopy , $ con ) ; if ( $ objects ) { return $ objects [ 0 ] ; } return null ; }
Selects one object from the DB .
6,785
public static function doSelect ( Criteria $ criteria , PropelPDO $ con = null ) { return ApiLogPeer :: populateObjects ( ApiLogPeer :: doSelectStmt ( $ criteria , $ con ) ) ; }
Selects several row from the DB .
6,786
public function getDefaultPassword ( ) : ? PasswordBroker { $ manager = Password :: getFacadeRoot ( ) ; if ( isset ( $ manager ) ) { return $ manager -> broker ( ) ; } return $ manager ; }
Get a default password value if any is available
6,787
public function html ( ) { if ( ! $ this -> isMorphed ( ) ) $ this -> morph ( ) ; $ html = NULL ; foreach ( $ this -> elements as $ el ) { $ html .= $ el -> html ( ) . "\n" ; } return $ html ; }
Wenn noch nicht gemorphed wird das getan
6,788
public function set ( Mod $ mod ) : void { $ this -> loadMods ( ) ; $ this -> mods [ $ mod -> getName ( ) ] = $ mod ; }
Sets a mod into the registry .
6,789
public function get ( string $ modName ) : ? Mod { $ this -> loadMods ( ) ; return $ this -> mods [ $ modName ] ?? null ; }
Returns a mod from the registry .
6,790
public function saveMods ( ) : void { $ mods = [ ] ; foreach ( $ this -> mods as $ mod ) { $ mods [ ] = $ mod -> writeData ( ) ; } $ this -> saveContent ( self :: HASH_FILE_MODS , $ this -> encodeContent ( $ mods ) ) ; }
Saves the currently known mod to the adapter .
6,791
protected function loadMods ( ) : void { if ( ! $ this -> isLoaded ) { $ this -> mods = [ ] ; foreach ( $ this -> decodeContent ( ( string ) $ this -> loadContent ( self :: HASH_FILE_MODS ) ) as $ modData ) { if ( is_array ( $ modData ) ) { $ mod = new Mod ( ) ; $ mod -> readData ( new DataContainer ( $ modData ) ) ; $...
Loads the mods from the file .
6,792
public static function toRoman ( $ num ) { $ conv = array ( 10 => array ( 'X' , 'C' , 'M' ) , 5 => array ( 'V' , 'L' , 'D' ) , 1 => array ( 'I' , 'X' , 'C' ) ) ; $ roman = '' ; if ( $ num < 0 ) { return '' ; } $ num = ( int ) $ num ; $ digit = ( int ) ( $ num / 1000 ) ; $ num -= $ digit * 1000 ; while ( $ digit > 0 ) {...
Converts a number to its roman numeral representation
6,793
public function register ( ) { if ( ! $ this -> options -> exists ( ) ) { $ this -> reset ( ) ; } if ( $ this -> page -> get_slug ( ) == filter_input ( INPUT_GET , 'page' ) ) { $ this -> preprocess ( ) ; } $ this -> page -> register ( ) ; $ this -> set_global_variable ( ) ; $ this -> do_action ( 'afw_options_init' ) ; ...
Register the options page .
6,794
private function create_page ( ) { $ self = $ this ; $ page = new \ Amarkal \ Extensions \ WordPress \ Admin \ AdminPage ( array ( 'title' => $ this -> config -> sidebar_title , 'icon' => $ this -> config -> sidebar_icon , 'class' => $ this -> config -> sidebar_icon_class , 'style' => $ this -> config -> sidebar_icon_s...
Create a new AdminPage .
6,795
private function render ( ) { $ this -> do_action ( 'afw_options_pre_render' ) ; $ layout = new Layout \ Layout ( $ this -> config ) ; $ layout -> render ( true ) ; add_filter ( 'admin_footer_text' , array ( __CLASS__ , 'footer_credits' ) ) ; $ this -> do_action ( 'afw_options_post_render' ) ; }
Internally used to render the page . Called by AdminPage to generate the admin page s content .
6,796
private function preprocess ( ) { $ this -> do_action ( 'afw_options_pre_process' ) ; Notifier :: reset ( ) ; State :: set ( 'errors' , array ( ) ) ; $ this -> update ( ) ; $ this -> do_action ( 'afw_options_post_process' ) ; }
Internally used to update the options page s components .
6,797
private function set_errors ( $ errors ) { if ( count ( $ errors ) == 0 ) { return ; } $ errors_array = array ( ) ; foreach ( $ this -> config -> get_sections ( ) as $ section ) { foreach ( $ section -> get_fields ( ) as $ component ) { if ( $ component instanceof \ Amarkal \ UI \ ValidatableComponentInterface && $ err...
Set the state with the given errors .
6,798
private function set_global_variable ( ) { $ var_name = "" ; if ( null != $ this -> config -> global_variable ) { $ var_name = $ this -> config -> global_variable ; } else { $ var_name = $ this -> page -> get_slug ( ) . '_options' ; } $ GLOBALS [ $ var_name ] = $ this -> options -> get ( ) ; }
Set a global variable containing the option values to be used throughout the program .
6,799
public function filter ( $ field , $ filter , array $ options = [ ] ) { if ( ! in_array ( $ filter , [ self :: HTML , self :: NEWLINES , self :: WHITESPACE , self :: XSS ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Filter %s does not exist' , $ filter ) ) ; } $ this -> _filters [ $ field ] [ $ filter ] = $ o...
Define a filter for a specific field .