idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
53,500
public function validate ( $ value , & $ error = null ) { $ result = $ this -> validateValue ( $ value ) ; if ( empty ( $ result ) ) { return true ; } list ( $ message , $ params ) = $ result ; $ params [ 'attribute' ] = Yii :: t ( 'yii' , 'the input value' ) ; $ params [ 'value' ] = is_array ( $ value ) ? 'array()' : ...
Validates a given value . You may use this method to validate a value out of the context of a data model .
53,501
public function addError ( $ model , $ attribute , $ message , $ params = [ ] ) { $ value = $ model -> $ attribute ; $ params [ 'attribute' ] = $ model -> getAttributeLabel ( $ attribute ) ; $ params [ 'value' ] = is_array ( $ value ) ? 'array()' : $ value ; $ model -> addError ( $ attribute , Yii :: $ app -> getI18n (...
Adds an error about the specified attribute to the model object . This is a helper method that performs message selection and internationalization .
53,502
public static function getAllFiles ( $ dir , $ subdir = false ) { $ path = '' ; $ stack [ ] = $ dir ; while ( $ stack ) { $ thisdir = array_pop ( $ stack ) ; if ( $ dircont = scandir ( $ thisdir ) ) { $ i = 0 ; while ( isset ( $ dircont [ $ i ] ) ) { if ( $ dircont [ $ i ] !== '.' && $ dircont [ $ i ] !== '..' ) { $ cu...
Get all directory files and directories
53,503
public static function getAllSubdirectories ( $ dir , $ subdir = false ) { $ path = '' ; $ stack [ ] = $ dir ; while ( $ stack ) { $ thisdir = array_shift ( $ stack ) ; if ( $ dircont = scandir ( $ thisdir ) ) { $ i = 0 ; while ( isset ( $ dircont [ $ i ] ) ) { if ( $ dircont [ $ i ] !== '.' && $ dircont [ $ i ] !== '....
Get all subdirectories of directory
53,504
final public static function getValueOf ( $ rawValue ) { $ values = static :: getValues ( ) ; if ( ! array_key_exists ( $ rawValue , $ values ) ) { throw new OutOfBoundsException ( sprintf ( 'Enum "%s" has no value with raw value "%s".' , get_called_class ( ) , $ rawValue ) ) ; } return $ values [ $ rawValue ] ; }
Returns an instance of Enumerable by raw value .
53,505
private static function initializeEnum ( $ enumClass ) { self :: $ isInInitializationState = true ; try { $ classReflection = new ReflectionClass ( $ enumClass ) ; if ( ! $ classReflection -> isFinal ( ) ) { throw new LogicException ( sprintf ( 'Enumerable class must be final, but "%s" is not final.' , $ enumClass ) ) ...
Initializes values of enumerable class .
53,506
private static function isServiceMethod ( ReflectionMethod $ method ) { return ! $ method -> isPublic ( ) || in_array ( $ method -> getShortName ( ) , self :: getServiceMethods ( ) ) ; }
Checks that given method is for the internal use .
53,507
protected function BeforeDelete ( ) { foreach ( self :: $ deleteHooks as $ hook ) { $ hook -> BeforeDelete ( $ this -> item ) ; } $ logger = new Logger ( BackendModule :: Guard ( ) -> GetUser ( ) ) ; $ logger -> ReportPageAction ( $ this -> item , Action :: Delete ( ) ) ; $ file = Path :: Combine ( PHINE_PATH , 'Public...
Remove htaccess page commands before page is deleted
53,508
private function sanitize ( $ value , $ sanitizers ) { if ( is_string ( $ sanitizers ) === true ) return call_user_func ( $ sanitizers , $ value ) ; if ( is_array ( $ sanitizers ) === true ) { $ valueFiltered = $ value ; if ( count ( $ sanitizers ) === 2 && is_callable ( $ sanitizers ) === true ) return call_user_func ...
Sanitizes a value with the given functions and callbacks
53,509
public function parse ( $ marcspec ) { if ( ! preg_match_all ( '/' . $ this -> MARCSPEC . '/' , $ marcspec , $ this -> parsed , PREG_SET_ORDER ) ) { throw new InvalidMARCspecException ( InvalidMARCspecException :: FS . InvalidMARCspecException :: MISSINGFIELD , $ marcspec ) ; } $ this -> parsed = array_filter ( $ this ...
parses MARCspec .
53,510
public function parseSubfields ( $ subfieldspec ) { if ( ! preg_match_all ( '/' . $ this -> SUBFIELD . '/' , $ subfieldspec , $ _subfieldMatches , PREG_SET_ORDER ) ) { throw new InvalidMARCspecException ( InvalidMARCspecException :: SF . InvalidMARCspecException :: SFCHAR , $ subfieldspec ) ; } array_walk ( $ _subfield...
Matches subfieldspecs .
53,511
public function subfieldToArray ( $ subfieldspec ) { if ( ! $ _sf = $ this -> parseSubfields ( $ subfieldspec ) ) { throw new InvalidMARCspecException ( InvalidMARCspecException :: SF . InvalidMARCspecException :: UNKNOWN , $ subfieldspec ) ; } if ( 1 < count ( $ _sf ) ) { throw new InvalidMARCspecException ( InvalidMA...
calls parseSubfields but makes sure only one subfield is present .
53,512
private function matchSubSpecs ( $ subSpecs ) { $ _subSpecs = [ ] ; if ( ! preg_match_all ( '/' . $ this -> SUBSPEC . '/U' , $ subSpecs , $ _subSpecMatches , PREG_SET_ORDER ) ) { throw new InvalidMARCspecException ( InvalidMARCspecException :: SS . InvalidMARCspecException :: UNKNOWN , $ subSpecs ) ; } foreach ( $ _sub...
parses subspecs into an array .
53,513
private function matchSubTerms ( $ subSpec ) { if ( preg_match ( '/(?<![\\\\\$])[\{\}]/' , $ subSpec , $ _error , PREG_OFFSET_CAPTURE ) ) { throw new InvalidMARCspecException ( InvalidMARCspecException :: SS . InvalidMARCspecException :: ESCAPE , $ subSpec ) ; } if ( preg_match_all ( '/' . $ this -> SUBTERMS . '/' , $ ...
Parses a single SubSpec into sunTerms .
53,514
public function getBalance ( $ user_id , $ type = - 1 ) { $ url = $ this -> authenticationService -> getServerEndPoint ( ) . Endpoints :: VERSION . Endpoints :: BASE_WALLET . Endpoints :: WALLET_CREDITS_BALANCE ; $ url = sprintf ( $ url , $ user_id , $ type ) ; $ result = $ this -> authenticationService -> getTransport...
Get the wallet balance of a user
53,515
public function getTransactionDetail ( $ transaction_id ) { $ url = $ this -> authenticationService -> getServerEndPoint ( ) . Endpoints :: VERSION . Endpoints :: BASE_WALLET . Endpoints :: WALLET_TRANSACTION ; $ url = sprintf ( $ url , $ transaction_id ) ; $ result = $ this -> authenticationService -> getTransport ( )...
Get details about a particular transaction
53,516
public function getTransactionDetailsForUser ( $ user_id , $ count = 10 , $ paginated_url = null , $ page = 1 ) { if ( $ paginated_url ) { $ url = $ paginated_url ; } else { $ url = $ this -> authenticationService -> getServerEndPoint ( ) . Endpoints :: VERSION . Endpoints :: BASE_WALLET . Endpoints :: WALLET_TRANSACTI...
Get all transactions for a particular user
53,517
public function addBalance ( $ user_id , $ value_to_add , $ transaction_type = WalletTransactionTypes :: TRANSACTIONAL , $ expires_in_days = 0 , $ transaction_id = null , $ meta_data = null , $ tag = null , $ frozen = false ) { $ url = $ this -> authenticationService -> getServerEndPoint ( ) . Endpoints :: VERSION . En...
Add balance to a particular user s wallet
53,518
public function make ( ) { $ authority = $ this -> host ; $ fragment = $ this -> fragment ; $ query = $ this -> query ; if ( $ this -> host !== '' && $ this -> user !== null ) { $ user = $ this -> user ; if ( $ this -> pass ) { $ user = $ this -> user . ':' . $ this -> pass ; } $ authority = $ user . '@' . $ authority ...
Creates the URI instance .
53,519
public function user ( $ user , $ pass = null ) { if ( $ pass ) { $ this -> pass = $ pass ; } $ this -> user = $ user ; return $ this ; }
Sets the user component .
53,520
public function getTerms ( $ vocabulary_id ) { if ( ! $ data = Cache :: get ( $ this -> getTaxonomyCacheKey ( ) ) ) { $ data = $ this -> cacheTermsForContent ( ) ; } if ( ! is_numeric ( $ vocabulary_id ) ) { $ vocabulary_id = T :: vocabulary ( $ vocabulary_id ) ; } $ results = new Collection ( ) ; if ( array_key_exists...
Get the terms from a content
53,521
public function addTerm ( $ term_id ) { TermContainer :: findOrFail ( $ term_id ) ; if ( $ this -> getTaxonomyQuery ( ) -> where ( 'term_id' , $ term_id ) -> count ( ) ) { return ; } $ this -> taxonomies ( ) -> attach ( $ term_id ) ; Cache :: forget ( $ this -> getTaxonomyCacheKey ( ) ) ; }
Link a term to this content
53,522
public function removeTerms ( $ vocabulary_id = null ) { if ( $ vocabulary_id === null ) { return $ this -> getTaxonomyQuery ( ) -> delete ( ) ; } if ( ! is_numeric ( $ vocabulary_id ) ) { $ vocabulary_id = T :: vocabulary ( $ vocabulary_id ) ; } return $ this -> getTaxonomyQuery ( ) -> whereIn ( 'term_id' , function (...
Removes terms specified by a vocabulary or all
53,523
private function getTaxonomyQuery ( ) { $ t = $ this -> taxonomies ( ) ; return $ t -> newPivotStatement ( ) -> where ( $ t -> getForeignKey ( ) , $ this -> getKey ( ) ) -> where ( $ t -> getMorphType ( ) , $ t -> getMorphClass ( ) ) ; }
Get a new plain query builder for the pivot table .
53,524
public function commit ( ) { return setcookie ( $ this -> name , $ this -> value , $ this -> expires , $ this -> path , $ this -> domain , $ this -> secure , $ this -> httpOnly ) ; }
Send the cookie
53,525
public function addListener ( $ listener , $ event , $ prior = null ) { if ( ! is_callable ( $ event ) ) { return false ; } if ( ! array_key_exists ( $ listener , $ this -> listeners ) ) { $ this -> listeners [ $ listener ] = [ ] ; } if ( ! $ prior ) { $ this -> listeners [ $ listener ] [ ] = $ event ; } else { array_s...
Add listener on event
53,526
public function signal ( $ listener , array $ params = [ ] ) { $ result = null ; if ( array_key_exists ( $ listener , $ this -> listeners ) && 0 !== count ( $ this -> listeners [ $ listener ] ) ) { foreach ( $ this -> listeners [ $ listener ] as $ listen ) { $ result = call_user_func ( $ listen , $ params ) ; if ( $ re...
Send signal to run event
53,527
public function isValidResponse ( $ username , $ hash , $ challenge ) { if ( self :: NTLM_BLOB_HEADER != substr ( $ this -> clientBlob , 0 , 8 ) ) { return false ; } if ( ! SecurityUtil :: timingSafeEquals ( $ username , $ this -> username ) ) { return false ; } if ( ! SecurityUtil :: timingSafeEquals ( $ this -> provi...
Needs the MD4 hash of the UTF - 16LE encoded password of the user in hex - or binary format .
53,528
public function light ( ) { $ forms = safe_column ( 'name' , 'txp_form' , '1 = 1' ) ; $ beacon = new Rah_Beacon_Handler ( ) ; foreach ( $ forms as $ name ) { if ( ! preg_match ( '/^[a-z][a-z0-9_]*$/' , $ name ) ) { trace_add ( '[rah_beacon: ' . $ name . ' skipped]' ) ; continue ; } Txp :: get ( 'Textpattern_Tag_Registr...
Registers forms as tags .
53,529
public function atts ( $ atts ) { global $ variable ; foreach ( lAtts ( $ atts , $ variable , false ) as $ name => $ value ) { $ variable [ $ name ] = $ value ; } }
A tag for assigning attribute defaults for tags .
53,530
private function loadConfigPackages ( ) { $ config = Container :: getInstance ( ) -> get ( 'config' ) ; $ list = $ config -> get ( 'global.package' ) ; if ( empty ( $ list ) || ! is_array ( $ list ) ) { return ; } foreach ( $ list as $ name => $ data ) { if ( ! isset ( $ data [ 'config' ] ) ) { continue ; } $ config ->...
Load configs from packages .
53,531
private function _merge_values ( $ data , $ values , $ columns ) { foreach ( $ values as $ key => $ value ) { if ( ! is_numeric ( $ key ) && $ key != '[]' ) { if ( isset ( $ columns [ $ key ] ) ) { $ type = strtolower ( $ columns [ $ key ] ) ; if ( $ value === null ) { $ type = 'null' ; } switch ( $ type ) { case 'int'...
Attach Value to row data .
53,532
private function _define_column_types ( \ PDOStatement $ result ) { $ columns = array ( ) ; $ intTypes = array ( 'int' , 'integer' , 'long' , 'tiny' , 'smallint' , 'int4' ) ; try { for ( $ i = 0 ; $ i < $ result -> columnCount ( ) ; ++ $ i ) { $ meta = $ result -> getColumnMeta ( $ i ) ; if ( $ meta && $ meta [ 'name' ...
Define columns from result .
53,533
public function addThreshold ( $ threshold , $ driver ) { if ( ! is_int ( $ threshold ) || $ threshold <= 0 ) { throw new InvalidArgumentException ( "The threshold '{$threshold}' is invalid. The threshold must be an integer and greater than '0'." ) ; } $ this -> sortThresholds [ $ threshold ] = $ driver ; }
Adds a new sorting algorithm with the specified threshold
53,534
public function determineDriver ( $ collectionCount ) { $ determinedDriver = 'native' ; ksort ( $ this -> sortThresholds , SORT_NUMERIC ) ; foreach ( $ this -> sortThresholds as $ threshold => $ driver ) { if ( $ collectionCount <= $ threshold ) { $ determinedDriver = $ driver ; break ; } } return $ determinedDriver ; ...
Determines the driver to use based on a collection s size
53,535
protected function getSessionObject ( $ access_token = NULL ) { $ session = NULL ; if ( ! empty ( $ access_token ) && isset ( $ access_token [ 'access_token' ] ) ) { $ session [ 'access_token' ] = $ access_token [ 'access_token' ] ; $ session [ 'base_domain' ] = $ this -> getVariable ( 'base_domain' , self :: DEFAULT_B...
Try to get session object from custom method .
53,536
protected function makeOAuth2Request ( $ path , $ method = 'GET' , $ params = array ( ) ) { if ( ( ! isset ( $ params [ 'access_token' ] ) || empty ( $ params [ 'access_token' ] ) ) && $ oauth_token = $ this -> getAccessToken ( ) ) { $ params [ 'access_token' ] = $ oauth_token ; } return $ this -> makeRequest ( $ path ...
Make an OAuth2 . 0 Request .
53,537
public function all ( $ scopes = [ ] ) { return $ this -> _get ( 'servers/' . $ this -> server_id . '/software/' . $ this -> software_id . '/exploits' , null , $ scopes ) ; }
Gets a list of all exploits of this particular software
53,538
protected function tableExists ( $ tableName ) { if ( isset ( $ this -> nonExistingTables [ $ tableName ] ) ) return false ; if ( isset ( $ this -> existingTables [ $ tableName ] ) ) return true ; $ exists = $ this -> schemaManager -> tablesExist ( array ( $ tableName ) ) ; if ( ! $ exists ) { $ this -> nonExistingTabl...
Checks if the given table exists
53,539
protected function validateMappings ( $ mappings , $ allowAssociations ) { $ type = null ; foreach ( $ mappings as $ mapping ) { switch ( $ mapping -> type ) { case Type :: TIMESTAMP : $ thisType = Type :: DATE ; break ; case Type :: FLOAT : $ thisType = Type :: INT ; break ; default : if ( ! $ mapping -> isAssociation...
Validate that the provided mappings use compatible serialization strategies .
53,540
public function checkTableExist ( $ table , $ con = NULL ) { $ connection = $ this -> checkConnection ( $ con ) ; $ query = $ connection -> query ( "SELECT 1 FROM {$table} LIMIT 1" ) ; if ( $ query !== false ) { return true ; } }
checkTableExist Check if table already in the database
53,541
protected static function checkTableName ( $ tableName , $ con = NULL ) { $ connection = self :: checkConnection ( $ con ) ; $ query = $ connection -> query ( "SELECT 1 FROM {$tableName} LIMIT 1" ) ; if ( $ query !== false ) { return $ tableName ; } throw new TableDoesNotExistException ( ) ; }
checkTableName Return the table name
53,542
protected static function checkColumn ( $ tableName , $ columnName , $ con = NULL ) { $ connection = self :: checkConnection ( $ con ) ; $ result = $ connection -> prepare ( "SELECT {$columnName} FROM {$tableName}" ) ; $ result -> execute ( ) ; if ( ! $ result -> columnCount ( ) ) { throw new ColumnNotExistExeption ( )...
checkColumn Check if column exist in table
53,543
protected static function buildColumn ( $ data ) { $ counter = 0 ; $ insertQuery = "" ; $ arraySize = count ( $ data ) ; foreach ( $ data as $ key => $ value ) { $ counter ++ ; $ insertQuery .= self :: sanitize ( $ key ) ; if ( $ arraySize > $ counter ) $ insertQuery .= ", " ; } return $ insertQuery ; }
buildColumn Build the column name
53,544
protected static function buildClause ( $ tableName , $ data ) { $ counter = 0 ; $ updateQuery = "" ; $ arraySize = count ( $ data ) ; foreach ( $ data as $ key => $ value ) { $ counter ++ ; $ columnName = self :: checkColumn ( $ tableName , self :: sanitize ( $ key ) ) ; $ updateQuery .= $ columnName . " = '" . self :...
buildClause Build the clause value
53,545
protected function fields ( ) { if ( isset ( $ this -> fillables ) ) { $ this -> output = ( sizeof ( $ this -> fillables ) > 0 ) ? implode ( $ this -> fillables , ',' ) : '*' ; } else { $ this -> output = '*' ; } return $ this -> output ; }
Get the fields to be fillables defined in the model
53,546
public function addModule ( Module $ module ) { if ( $ this -> db !== $ module -> getDB ( ) ) throw new MigrationException ( "The DB instances should be the same" ) ; $ name = self :: normalizeModule ( $ module -> getModule ( ) ) ; $ this -> modules [ $ name ] = $ module ; return $ this ; }
Register a module that has already been instantiated
53,547
public function addMigration ( string $ module , string $ path ) { $ module = self :: normalizeModule ( $ module ) ; if ( isset ( $ this -> modules [ $ module ] ) ) throw new MigrationException ( "Duplicate module: " . $ module ) ; $ instance = new Module ( $ module , $ path , $ this -> db ) ; $ this -> modules [ $ mod...
Add a new migration using a module name and a path
53,548
public function getDeploymentRevision ( ) { if ( $ this -> version === false ) { $ version = $ this -> cache -> get ( 'DeploymentRevision' ) ; if ( $ version === false ) { $ version = $ this -> versionDao -> getSystemVersion ( ) ; if ( $ version === false ) $ version = $ this -> incrementDeploymentRevision ( 'Initial s...
Returns the current system version
53,549
public function incrementDeploymentRevision ( $ details = null ) { if ( ! $ this -> incrementedOnce ) { $ backtrace = null ; $ version = $ this -> versionDao -> insertSystemVersion ( $ details , $ backtrace ) ; $ this -> Events -> trigger ( 'SystemVersion.increment' , $ version ) ; $ this -> version = $ version ; $ thi...
Increases the current SystemVersion by one
53,550
private function build ( $ pString ) { for ( $ i = 0 ; $ i < strlen ( $ pString ) ; $ i ++ ) { $ this -> addChar ( $ pString [ $ i ] ) ; } }
Builds the suffix tree off the given string
53,551
private function addSuffixLink ( $ pNode ) { if ( $ this -> needSuffixLink > 0 ) { $ this -> nodes [ $ this -> needSuffixLink ] -> link = $ pNode ; } $ this -> needSuffixLink = $ pNode ; }
Adds the given node as target of the current suffix link
53,552
private function newNode ( $ pStart , $ pEnd ) { $ this -> nodes [ ++ $ this -> currentNode ] = new Node ( $ pStart , $ pEnd , $ this -> currentNode ) ; return $ this -> currentNode ; }
Creates as new node with given start and end indexes . Increases the current node by one .
53,553
private function addChar ( $ pChar ) { $ this -> text [ ++ $ this -> position ] = $ pChar ; $ this -> needSuffixLink = - 1 ; $ this -> remainder ++ ; while ( $ this -> remainder > 0 ) { if ( $ this -> activeLength === 0 ) { $ this -> activeEdge = $ this -> position ; } if ( ! array_key_exists ( $ this -> getActiveEdge ...
Adds a single character to the suffix tree . Updates edges as well as nodes
53,554
public function getAllSurpriseValues ( ) { $ allSurprises = array ( ) ; foreach ( $ this -> nodes as $ node ) { if ( $ node -> start != - 1 && $ node -> end != - 1 ) { $ allSurprises [ ] = $ node -> surpriseValue ; } } return $ allSurprises ; }
Returns an array containing the surprise values of each node of this tree .
53,555
private function findSurpriseValue ( Node $ pNode , $ pSubstring ) { $ length = $ pNode -> end - $ pNode -> start ; $ text = implode ( '' , $ this -> text ) ; if ( ( $ pNode -> start != - 1 && $ pNode -> end != - 1 ) ) { if ( substr ( $ text , $ pNode -> start , $ length ) === $ pSubstring ) { return $ pNode -> surpris...
Tries to find the surprise value of the given substring in the given node . If not successfull for the given string and a child node starts with the first letter of the given string it will try its corresponding child . Used in a recursive manner with given node representing the root node at the begin
53,556
public function hasSubstring ( $ pSubstring ) { if ( strlen ( $ pSubstring ) < 1 ) { return - 1 ; } return $ this -> findSubstring ( $ this -> nodes [ $ this -> root ] , $ pSubstring ) ; }
Scan tree for occurences of the given substring .
53,557
public function setSSLKey ( $ certificateFile , $ password = null ) { if ( $ password ) { $ this -> options [ GuzzleRequestOptions :: SSL_KEY ] = [ $ certificateFile , $ password ] ; } else { $ this -> options [ GuzzleRequestOptions :: SSL_KEY ] = $ certificateFile ; } }
Specify the path to a file containing a private SSL key in PEM format .
53,558
public function setCertificate ( $ certificateFile , $ password = null ) { if ( $ password ) { $ this -> options [ GuzzleRequestOptions :: CERT ] = [ $ certificateFile , $ password ] ; } else { $ this -> options [ GuzzleRequestOptions :: CERT ] = $ certificateFile ; } }
Set to a string to specify the path to a file containing a PEM formatted client side certificate
53,559
public function addHeader ( $ key , $ value ) { $ this -> options [ GuzzleRequestOptions :: HEADERS ] [ $ key ] = $ value ; return $ this ; }
Headers to add to the request .
53,560
public function addQuery ( $ param , $ value ) { if ( ! isset ( $ this -> options [ GuzzleRequestOptions :: QUERY ] ) ) { $ this -> options [ GuzzleRequestOptions :: QUERY ] = [ ] ; } if ( ! is_array ( $ this -> options [ GuzzleRequestOptions :: QUERY ] ) ) { throw new \ LogicException ( 'The query has been set as stri...
Add Query string parameter
53,561
public function setAuth ( $ username , $ password , $ type = 'basic' ) { $ this -> options [ GuzzleRequestOptions :: AUTH ] = [ $ username , $ password , $ type ] ; return $ this ; }
Specifies HTTP authorization parameters to use with the request
53,562
public function get ( $ option ) { return ( isset ( $ this -> options [ $ option ] ) ? $ this -> options [ $ option ] : null ) ; }
Get a option value
53,563
public function dump ( ) { $ dump = [ ] ; if ( $ this -> hasParameters ( ) ) { foreach ( $ this -> parameters as $ parameter ) { $ dump [ $ parameter -> getName ( ) ] = $ parameter -> dump ( ) ; } } return $ dump ; }
Dump parameters .
53,564
private function ClassFile ( ) { if ( ! $ this -> classFile ) { $ class = new \ ReflectionClass ( $ this ) ; $ this -> classFile = $ class -> getFileName ( ) ; } return $ this -> classFile ; }
The class definition file
53,565
function Render ( ) { $ templateDir = Path :: Combine ( __DIR__ , 'Templates' ) ; $ templateFile = Path :: AddExtension ( Path :: Filename ( $ this -> ClassFile ( ) ) , 'phtml' , true ) ; ob_start ( ) ; require Path :: Combine ( $ templateDir , $ templateFile ) ; return ob_get_clean ( ) ; }
Renders and returns the html output
53,566
function Value ( $ field , $ trim = true ) { $ result = Request :: IsPost ( ) ? Request :: PostData ( $ field ) : $ this -> DefaultValue ( $ field ) ; if ( $ trim ) { return trim ( $ result ) ; } return $ result ; }
Gets the value of a field
53,567
function GotoNext ( ) { $ next = Page :: NextStep ( $ this -> Step ( ) ) ; Response :: Redirect ( Path :: AddExtension ( $ next , 'php' ) ) ; }
Redirects to the next step
53,568
protected function generateDeleteView ( $ dir ) { $ this -> renderFile ( 'crud/views/delete.html.twig.twig' , $ dir . '/delete.html.twig' , [ 'route_prefix' => $ this -> routePrefix , 'route_name_prefix' => $ this -> routeNamePrefix , 'entity' => $ this -> entity , 'bundle' => $ this -> bundle -> getName ( ) , 'actions...
Generates the delete . html . twig template in the final bundle .
53,569
public function get ( $ modelName , $ directory = null ) { if ( empty ( $ modelName ) ) { throw new ModelException ( "Could not load model. No name provided" , 1 ) ; } $ directories = ( is_null ( $ directory ) ? $ this -> modelPaths : array ( $ directory ) ) ; $ event = Events :: fireEvent ( 'modelLoadEvent' , $ modelN...
Get a model .
53,570
protected function loadModel ( $ modelName , $ directories ) : ModelAbstract { if ( empty ( $ directories ) ) { throw new ModelException ( "Could not load model. No directories provided" , 1 ) ; } $ class = trim ( $ modelName , '/' ) ; if ( ( $ last_slash = strrpos ( $ class , '/' ) ) !== FALSE ) { $ subdir = substr ( ...
Load and return a model .
53,571
public function removeModelPath ( $ directory ) { if ( ( $ key = array_search ( $ directory , $ this -> modelPaths ) ) !== false ) { unset ( $ this -> modelPaths [ $ key ] ) ; } }
Remove a path where models can be found
53,572
public static function setDefaultEncoding ( $ encoding = null ) { if ( ! is_null ( $ encoding ) && is_string ( $ encoding ) && ! empty ( $ encoding ) ) { self :: $ defaultencoding = $ encoding ; } else { self :: $ defaultencoding = null ; } }
Set global default encoding
53,573
public function newInstance ( $ value = null ) { $ class = $ this -> getClassName ( ) ; $ o = new $ class ( $ value , $ this -> encoding ) ; return $ o ; }
Creates new instance of current class type
53,574
protected function getEncoding ( $ encoding = null ) { if ( is_null ( $ encoding ) ) { if ( ! is_null ( $ this -> encoding ) ) { return $ this -> encoding ; } return self :: getDefaultEncoding ( ) ; } return $ encoding ; }
Helper function to set default encoding
53,575
public function substr ( $ start , $ length = null ) { return $ this -> newInstance ( mb_substr ( $ this -> toString ( ) , $ start , $ length , $ this -> getEncoding ( ) ) ) ; }
Return a substring of value
53,576
public function split ( $ separator ) { $ temp = explode ( $ separator , $ this -> toString ( ) ) ; $ list = ArrayList :: asType ( $ this -> getClassName ( ) , $ temp ) ; return $ list ; }
Split string by separator
53,577
protected function padDynamic ( $ padstr , $ length , $ type ) { return $ this -> newInstance ( str_pad ( $ this -> toString ( ) , $ length , $ padstr , $ type ) ) ; }
Helper function for string padding
53,578
protected function indexOfDyamic ( $ function , $ needle , $ offset ) { $ r = $ function ( $ this -> toString ( ) , $ needle , $ offset , $ this -> getEncoding ( ) ) ; return ( $ r === false ? - 1 : $ r ) ; }
Helper function for strpos
53,579
protected function lastIndexOfDynamic ( $ function , $ needle , $ offset = 0 ) { $ r = $ function ( $ this -> toString ( ) , $ needle , $ offset , $ this -> getEncoding ( ) ) ; return ( $ r === false ? - 1 : $ r ) ; }
Helper function for strrpos
53,580
protected function endsWithDynamic ( $ function , $ needle ) { $ enc = $ this -> getEncoding ( ) ; $ strlen = $ this -> length ( $ enc ) ; $ testlen = mb_strlen ( $ needle , $ enc ) ; if ( $ testlen <= $ strlen ) { return ( $ function ( $ this -> toString ( ) , $ needle , ( $ strlen - $ testlen ) , $ enc ) !== false ) ...
Helper function for endsWith
53,581
public function match ( $ regex ) { $ match = array ( ) ; if ( $ this -> isValidRegex ( $ regex ) && preg_match ( $ regex , $ this -> toString ( ) , $ match ) === 1 ) { return new ObjectArray ( $ match ) ; } return null ; }
Match value against regex
53,582
public function matchAll ( $ regex ) { $ matches = array ( ) ; $ result = preg_match_all ( $ regex , $ this -> toString ( ) , $ matches , PREG_SET_ORDER ) ; if ( $ this -> isValidRegex ( $ regex ) && $ result !== false && $ result > 0 ) { return ArrayList :: asObjectArray ( $ matches ) ; } return null ; }
Get all matches by regex
53,583
public function CreateArray ( ) { $ allPackages = $ this -> allLaSalleSoftwarePackages ( ) ; $ installedPackages = [ ] ; foreach ( $ allPackages as $ class ) { if ( defined ( "\\" . $ class . "\\Version::VERSION" ) ) { $ installedPackages [ ] = [ 'class' => $ class , 'version' => constant ( "\\" . $ class . "\\Version:...
What LaSalle Software packages are installed?
53,584
public function addStyle ( $ href , $ path = null ) { $ key = $ this -> calculateKey ( $ href , $ path ) ; $ this -> styles [ $ key ] = 1 ; return $ this ; }
this method add css file
53,585
public function deleteStyle ( $ href , $ path = null ) { $ key = $ this -> calculateKey ( $ href , $ path ) ; if ( isset ( $ this -> styles [ $ key ] ) ) { unset ( $ this -> styles [ $ key ] ) ; } return $ this ; }
This method remove css file from list
53,586
public function buildCode ( ) { $ res = '' ; foreach ( $ this -> styles as $ href => $ val ) { $ res .= '<link href="' . $ href . '" rel="stylesheet" type="text/css" />' . "\r\n" ; } return $ res ; }
This method generate code for include css files
53,587
public static function fromQName ( $ qn ) { $ qname = new QNameValue ( ) ; $ qname -> LocalName = $ qn -> localName ; $ qname -> Prefix = $ qn -> prefix ; $ qname -> NamespaceUri = $ qn -> namespaceURI ; if ( strlen ( $ qn -> localName ) == 0 || ! preg_match ( "/^" . NameValue :: $ ncName . "$/u" , $ qn -> localName ) ...
Create a QNameValue from a QName
53,588
public static function fromXPathNavigator ( $ node ) { return QNameValue :: fromQName ( new \ lyquidity \ xml \ qname ( $ node -> getPrefix ( ) , $ node -> getNamespaceURI ( ) , $ node -> getLocalName ( ) ) ) ; }
Create a QNameValue instance fron an XPathNavigator instance
53,589
public function isValid ( $ discount , $ request ) { $ code = $ this -> validate ( $ discount , $ request ) ; if ( $ code == Discount_Engine :: VALIDATION_CODE_VALID ) return true ; return false ; }
Check if give discount is valid or not .
53,590
private function buildUrl ( $ mode , $ params = [ ] ) { $ urlParams = array_merge ( [ 'mode' => $ mode , 'apikey' => $ this -> apiKey , 'output' => 'json' ] , $ params ) ; return 'http://' . $ this -> url . ':' . $ this -> port . "/api?" . http_build_query ( $ urlParams ) ; }
Url builder helper
53,591
public function queue ( $ start = 0 , $ limit = 100 ) { $ url = $ this -> buildUrl ( 'queue' , [ 'start' => $ start , 'limit' => $ limit ] ) ; $ request = $ this -> guzzle -> request ( 'GET' , $ url ) ; return json_decode ( $ request -> getBody ( ) , true ) [ 'queue' ] ; }
Returns all items currently in the queue and some additional information
53,592
public function history ( $ category = '' , $ start = 0 , $ limit = 100 , $ failedOnly = false ) { $ url = $ this -> buildUrl ( 'history' , [ 'start' => $ start , 'limit' => $ limit , 'failed_only' => $ failedOnly , 'category' => $ category ] ) ; $ request = $ this -> guzzle -> request ( 'GET' , $ url ) ; return json_d...
Returns all items in the history and some additional information
53,593
public function deleteQueueEntries ( $ entries ) { $ url = $ this -> buildUrl ( 'queue' , [ 'name' => 'delete' , 'value' => implode ( ',' , $ entries ) ] ) ; $ request = $ this -> guzzle -> request ( 'GET' , $ url ) ; return json_decode ( $ request -> getBody ( ) , true ) [ 'status' ] ; }
Deletes multiple entries with the given ids from the queue
53,594
public function switchQueueEntries ( $ first , $ second ) { $ url = $ this -> buildUrl ( 'switch' , [ 'value' => $ first , 'value2' => $ second ] ) ; $ request = $ this -> guzzle -> request ( 'GET' , $ url ) ; return json_decode ( $ request -> getBody ( ) , true ) [ 'result' ] ; }
Switches two entries in the queue
53,595
public function pauseQueue ( ) { $ url = $ this -> buildUrl ( 'set_pause' ) ; $ request = $ this -> guzzle -> request ( 'GET' , $ url ) ; return json_decode ( $ request -> getBody ( ) , true ) [ 'status' ] ; }
Pauses the whole queue
53,596
public function pauseQueueTemporary ( $ time ) { $ url = $ this -> buildUrl ( 'config' , [ 'name' => 'set_pause' , 'value' => $ time ] ) ; $ request = $ this -> guzzle -> request ( 'GET' , $ url ) ; return json_decode ( $ request -> getBody ( ) , true ) [ 'status' ] ; }
Pauses the queue temporarely for the given amount of time .
53,597
public function addUrl ( $ url , $ niceName = null , $ priority = - 100 , $ category = '' , $ postProcessing = 3 , $ script = '' ) { $ params = [ 'name' => $ url , 'priority' => $ priority , 'category' => $ category , 'pp' => $ postProcessing , 'script' => $ script ] ; if ( $ niceName ) { $ params [ 'nzbname' ] = $ nic...
Adds a file to the queue via the given link to the file
53,598
public function deleteHistoryEntries ( $ ids , $ withFiles = true ) { $ params = [ 'name' => 'delete' , 'del_files' => $ withFiles , 'value' => implode ( ',' , $ ids ) ] ; $ url = $ this -> buildUrl ( 'history' , $ params ) ; $ request = $ this -> guzzle -> request ( 'GET' , $ url ) ; return json_decode ( $ request -> ...
Deletes the history entry with the given id
53,599
public function deleteAllHistoryEntries ( $ withFiles = true ) { $ params = [ 'name' => 'delete' , 'del_files' => $ withFiles , 'value' => 'all' ] ; $ url = $ this -> buildUrl ( 'history' , $ params ) ; $ request = $ this -> guzzle -> request ( 'GET' , $ url ) ; return json_decode ( $ request -> getBody ( ) , true ) [ ...
Deletes all history entries