idx
int64
0
241k
question
stringlengths
64
6.21k
target
stringlengths
5
803
228,400
public function isRolledback ( $ transaction = RecordManager :: TRANSACTIONS_ALL ) { $ output = false ; foreach ( $ this -> getStatus ( $ transaction ) as $ transaction => $ transactionStatus ) { foreach ( $ transactionStatus as $ status ) { $ output = ( $ output || $ status === self :: ROLLEDBACK || $ status === self ...
Has a named transaction been rolledback
228,401
public function doneAnything ( ) { $ output = false ; foreach ( $ this -> status as $ transaction => $ transactionStatus ) { foreach ( $ transactionStatus as $ status ) { $ output = ( $ output || $ status === self :: SUCCESS ) ; } } return $ output ; }
Have we actually done anything?
228,402
public function filterByObject ( $ objectOrArray ) { $ response = new Response ( ) ; if ( ! is_array ( $ objectOrArray ) ) { $ objectOrArray = array ( $ objectOrArray ) ; } foreach ( $ objectOrArray as $ object ) { if ( ! is_object ( $ object ) ) { throw new \ InvalidArgumentException ( "can't findTransactionByObject i...
Get transaction response by object
228,403
public function getStatusText ( ) { $ statusCode = $ this -> getStatusCode ( ) ; if ( ! isset ( $ this -> defaultStatusTextList [ $ statusCode ] ) ) { return '' ; } return $ this -> defaultStatusTextList [ $ statusCode ] ; }
Retrieve the status text or empty string if one cannot be found
228,404
public function lookup_token_type ( $ findThis ) { $ retval = 0 ; $ sql = "SELECT * FROM cswal_token_type_table WHERE token_type=:type" ; try { $ numrows = $ this -> db -> run_query ( $ sql , array ( 'type' => $ findThis ) ) ; if ( $ numrows == 1 ) { $ data = $ this -> db -> get_single_record ( ) ; $ retval = $ data [ ...
Lookup a token type .
228,405
public function update_type ( $ id , $ type , $ desc ) { $ sql = "UPDATE cswal_token_type_table SET token_type=:type, token_desc=:desc WHERE token_type_id=:id" ; $ params = array ( 'id' => $ id , 'type' => $ type , 'desc' => $ desc , ) ; try { $ retval = $ this -> db -> run_update ( $ sql , $ params ) ; } catch ( Ex...
Updates the given ID in the token_type table .
228,406
public function create_token ( $ password , $ valueToStore = null , $ tokenId = null , $ lifetime = null , $ maxUses = null , $ tokenType = 0 , $ uid = 0 ) { if ( is_null ( $ tokenId ) || strlen ( $ tokenId ) < 1 ) { $ tokenId = $ this -> generate_token_string ( ) ; } $ finalHash = password_hash ( $ password , $ this -...
Build a token record in the database that can be authenticated against later .
228,407
public function destroy_token ( $ tokenId ) { try { $ sql = "DELETE FROM " . $ this -> table . " WHERE auth_token_id=:tokenId" ; $ deleteRes = $ this -> db -> run_update ( $ sql , array ( 'tokenId' => $ tokenId ) ) ; } catch ( exception $ e ) { throw new exception ( __METHOD__ . ": failed to destroy token::: " . $ e ->...
Deletes the given token ID from the database .
228,408
public function get_token_data ( $ tokenId ) { try { $ sql = "SELECT *, (max_uses - total_uses) as remaining_uses, " . "(NOW() - expiration) as time_remaining " . "FROM " . $ this -> table . " AS t1 INNER JOIN cswal_token_type_table AS t2 ON (t1.token_type_id=t2.token_type_id) WHERE auth_token_id=:tokenId" ;...
Retrieve data for the given ID .
228,409
public function attachmentsHaveApprovedFileExtensions ( $ mappedVars ) { if ( $ mappedVars [ 'number_of_attachments' ] == 0 ) { return true ; } $ approvedFileExtensions = config ( 'lasallecmsemail.inbound_attachments_approved_file_extensions' ) ; if ( empty ( $ approvedFileExtensions ) ) { return true ; } for ( $ i = 1...
All attachments have approved file extensions?
228,410
public function emailsComeFromListOfApprovedSenders ( $ emailAddress ) { if ( ! $ this -> isInboundEmailsFromAllowedSendersOnly ( ) ) { return true ; } if ( $ this -> isInboundEmailsFromAllowedSendersOnlyListOfSsenders ( $ emailAddress ) ) { return true ; } return false ; }
Check if emails must come from a list of approved senders . That is the person sending the email is allowed to send us inbound emails .
228,411
public static function generate ( $ network , Content $ page ) { $ text = self :: truncate ( $ page -> description , 137 ) ; return str_replace ( [ '{url}' , '{title}' , '{text}' , '{image}' ] , [ urlencode ( $ page -> url ) , urlencode ( $ page -> title ) , urlencode ( $ text ) , urlencode ( $ page -> get ( 'image' ) ...
Generate social network link .
228,412
public function decodeProperties ( $ properties , $ cache = false ) { $ this -> has_nocache_code = $ properties [ 'has_nocache_code' ] ; $ this -> properties [ 'nocache_hash' ] = $ properties [ 'nocache_hash' ] ; if ( isset ( $ properties [ 'cache_lifetime' ] ) ) { $ this -> properties [ 'cache_lifetime' ] = $ properti...
This function is executed automatically when a compiled or cached template file is included
228,413
public function cmdGetStore ( ) { $ result = $ this -> getListStore ( ) ; $ this -> outputFormat ( $ result ) ; $ this -> outputFormatTableStore ( $ result ) ; $ this -> output ( ) ; }
Callback for store - get command
228,414
public function cmdDeleteStore ( ) { $ id = $ this -> getParam ( 0 ) ; if ( empty ( $ id ) || ! is_numeric ( $ id ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid argument' ) ) ; } if ( ! $ this -> store -> delete ( $ id ) ) { $ this -> errorAndExit ( $ this -> text ( 'Unexpected result' ) ) ; } $ this -> outpu...
Callback for store - delete command
228,415
public function cmdUpdateStore ( ) { $ params = $ this -> getParam ( ) ; if ( empty ( $ params [ 0 ] ) || count ( $ params ) < 2 ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid command' ) ) ; } if ( ! is_numeric ( $ params [ 0 ] ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid argument' ) ) ; } $ this ->...
Callback for store - update command
228,416
protected function setStatusStore ( $ status ) { $ id = $ this -> getParam ( 0 ) ; $ all = $ this -> getParam ( 'all' ) ; if ( ! isset ( $ id ) && empty ( $ all ) ) { $ this -> errorAndExit ( $ this -> text ( 'Invalid command' ) ) ; } $ result = false ; if ( isset ( $ id ) ) { if ( ! is_numeric ( $ id ) ) { $ this -> e...
Sets status for one or several stores
228,417
protected function submitAddStore ( ) { $ this -> setSubmitted ( null , $ this -> getParam ( ) ) ; $ this -> setSubmittedJson ( 'data' ) ; $ this -> validateComponent ( 'store' ) ; $ this -> addStore ( ) ; }
Add a new store at once
228,418
protected function addStore ( ) { if ( ! $ this -> isError ( ) ) { $ id = $ this -> store -> add ( $ this -> getSubmitted ( ) ) ; if ( empty ( $ id ) ) { $ this -> errorAndExit ( $ this -> text ( 'Unexpected result' ) ) ; } $ this -> line ( $ id ) ; } }
Add a store
228,419
protected function wizardAddStore ( ) { $ this -> validatePrompt ( 'name' , $ this -> text ( 'Name' ) , 'store' ) ; $ this -> validatePrompt ( 'domain' , $ this -> text ( 'Domain or IP' ) , 'store' ) ; $ this -> validatePrompt ( 'basepath' , $ this -> text ( 'Path' ) , 'store' , '' ) ; $ this -> validatePrompt ( 'statu...
Add a new store step by step
228,420
public static function getQualifiedType ( $ value ) { if ( is_null ( $ value ) ) return 'NULL' ; if ( is_string ( $ value ) ) return 'string' ; else if ( is_array ( $ value ) ) { if ( ! empty ( $ value ) ) { foreach ( $ value as $ val ) { $ array_type = self :: getQualifiedType ( $ val ) ; if ( $ array_type != null ) b...
Determines the type of the specified value
228,421
public static function compare ( $ val1 , $ val2 ) { if ( in_array ( self :: getQualifiedType ( $ val1 ) , array ( 'int' , 'boolean' , 'float' , 'NULL' ) ) ) return $ val1 == $ val2 ? 0 : ( ( $ val1 < $ val2 ) ? - 1 : 1 ) ; if ( self :: isSubclass ( $ val1 , 'Date' ) ) return self :: compare ( $ val1 -> toUnix ( ) , $ ...
Compare two items for equivalence . Supports Date objects and all native types .
228,422
public static function fromArray ( array $ items = [ ] ) : Attribute { $ obj = new static ( ) ; $ obj -> setName ( $ items [ 'name' ] ) -> setDescription ( isset ( $ items [ 'description' ] ) && is_string ( $ items [ 'description' ] ) ? $ items [ 'description' ] : '' ) -> setSqlDescriptor ( isset ( $ items [ 'sqlDescri...
Create item from array
228,423
public function write ( Collection $ sequences ) { $ sequences = clone $ sequences ; $ expression = '' ; if ( $ sequences -> count ( ) > 0 ) { $ sequences = $ sequences -> reverse ( ) ; $ length = $ sequences -> count ( ) ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ sequence = $ sequences [ $ i ] ; if ( isset ( $ se...
Writes a sequence history to a string representation of the expression .
228,424
private function cors ( $ request ) { $ origin = $ request -> server -> http_origin ; $ allowed = Config :: get ( 'cors.allowedOrigins' ) ; if ( in_array ( '*' , $ allowed ) || in_array ( $ origin , $ allowed ) ) { $ this -> withHeaders ( $ request ) ; } }
Handles cors .
228,425
private function withHeaders ( $ request ) { $ headers = Config :: get ( 'cors.allowedHeaders' ) ; $ methods = Config :: get ( 'cors.allowedMethods' ) ; $ exposed = Config :: get ( 'cors.exposedHeaders' ) ; $ maxAge = Config :: get ( 'cors.maxAge' ) ; $ request -> headers -> addMany ( [ 'Access-Control-Allow-Credential...
Adds cors headers .
228,426
public static function get_DateTime ( & $ dateTime ) { if ( $ dateTime instanceof DateTime ) { return $ dateTime ; } return ! is_null ( $ dateTime ) ? new DateTime ( $ dateTime ) : null ; }
Get datetime from Entity
228,427
public static function get_Inet ( & $ inet ) { if ( $ inet instanceof Inet ) { return $ inet ; } return ! is_null ( $ inet ) ? new Inet ( $ inet ) : null ; }
Get inet from Entity
228,428
public static function set_Inet ( $ inet ) { if ( $ inet instanceof Inet ) { return $ inet ; } try { $ inet = new Inet ( $ inet ) ; return $ inet ; } catch ( \ InvalidArgumentException $ e ) { return null ; } }
Set entity datetime
228,429
public static function get_Hstore ( & $ store ) { if ( $ store instanceof Hstore ) { return $ store ; } return ! is_null ( $ store ) ? new Hstore ( $ store ) : null ; }
Get hstore from Entity
228,430
public static function set_Hstore ( $ store ) { if ( $ store instanceof Hstore ) { return $ store ; } try { $ store = new Hstore ( $ store ) ; return $ store ; } catch ( \ InvalidArgumentException $ e ) { return null ; } }
Set entity Hstore
228,431
public static function get_Json ( & $ json ) { if ( $ json instanceof Json ) { return $ json ; } return ! is_null ( $ json ) ? new Json ( $ json ) : null ; }
Get Json from Entity
228,432
public static function set_Json ( $ json , $ inputValidate ) { if ( $ json instanceof Json ) { return $ json ; } elseif ( null === $ json ) { return null ; } elseif ( ! is_string ( $ json ) ) { return Json :: makeFromObject ( $ json ) ; } return new Json ( $ json , $ inputValidate ) ; }
Set entity json property
228,433
public static function get_StockState ( & $ state ) { if ( $ state instanceof StockState or null === $ state ) { $ state = StockState :: makeFromString ( $ state ) ; } return $ state ; }
Get StockState from Entity
228,434
public static function set_StockState ( $ state ) { if ( $ state instanceof StockState or null === $ state ) { $ state = StockState :: makeFromString ( $ state ) ; } return $ state ; }
Set entity StockState
228,435
public static function get_PgLargeObject ( & $ value , Base $ entity ) { if ( $ value instanceof PgLargeObject ) { return $ value -> isDeleted ( ) ? null : $ value ; } if ( is_intish ( $ value ) ) { $ value = new Oid ( $ value , $ entity -> r ( ) -> db ) ; } return ! is_null ( $ value ) ? new PgLargeObject ( $ value ) ...
Get entity PgLargeObject
228,436
public static function set_PgLargeObject ( $ value , $ inputValidate , Base $ entity ) { if ( $ value instanceof PgLargeObject ) { return $ value ; } if ( is_intish ( $ value ) ) { $ value = new Oid ( $ value , $ entity -> r ( ) -> db ) ; } return is_null ( $ value ) ? null : new PgLargeObject ( $ value ) ; }
Set PgLargeObject on entity
228,437
public function getResourceUri ( $ path , $ package = null ) { if ( strpos ( $ path , 'resource://' ) === 0 ) { $ matches = array ( ) ; if ( preg_match ( '#^resource://([^/]+)/Public/(.*)#' , $ path , $ matches ) === 1 ) { $ package = $ matches [ 1 ] ; $ path = $ matches [ 2 ] ; } else { throw new \ Exception ( sprintf...
Appends a shortened md5 of the file .
228,438
public function odd ( array $ storage ) { return $ this -> filter ( $ storage , function ( $ value ) { return $ this -> helper -> math ( ) -> isOdd ( $ value ) ; } ) ; }
1 3 5 ...
228,439
public function even ( array $ storage ) { return $ this -> filter ( $ storage , function ( $ value ) { return $ this -> helper -> math ( ) -> isEven ( $ value ) ; } ) ; }
0 2 4 ...
228,440
final function LoadToBackend ( ) { foreach ( $ this -> Dependencies ( ) as $ depedency ) { $ bundleName = $ depedency -> BundleName ( ) ; if ( ! in_array ( $ bundleName , self :: $ _loadedBundles ) ) { $ depManifest = ClassFinder :: Manifest ( $ bundleName ) ; $ depManifest -> LoadToBackend ( ) ; } } $ this -> LoadBack...
Loads the bundle with all dependencies
228,441
protected function LoadToFrontend ( Site $ site ) { foreach ( $ this -> Dependencies ( ) as $ depedency ) { $ bundleName = $ depedency -> BundleName ( ) ; if ( ! in_array ( $ bundleName , self :: $ _loadedBundles ) ) { $ depManifest = ClassFinder :: Manifest ( $ bundleName ) ; $ depManifest -> LoadToFrontend ( $ site )...
Loads the bundle code and translations to the f
228,442
static function LoadInstalledToBackend ( ) { $ bundles = InstalledBundle :: Schema ( ) -> Fetch ( ) ; foreach ( $ bundles as $ bundle ) { $ manifest = ClassFinder :: Manifest ( $ bundle -> GetBundle ( ) ) ; $ manifest -> LoadToBackend ( ) ; } }
Loads all installed bundles to the backend
228,443
static function LoadInstalledToFrontend ( Site $ site ) { $ bundles = InstalledBundle :: Schema ( ) -> Fetch ( ) ; foreach ( $ bundles as $ bundle ) { $ manifest = ClassFinder :: Manifest ( $ bundle -> GetBundle ( ) ) ; $ manifest -> LoadToFrontend ( $ site ) ; } }
Loads installed bundles to the frontend
228,444
public function getRawContent ( int $ max_length = - 1 ) { $ max_length = $ max_length < 0 ? $ this -> content_length : $ max_length ; $ max_length = min ( 4096 * 1024 , $ max_length , $ this -> content_length ) ; $ str = $ this -> getContentStream ( ) ; $ data = stream_get_contents ( $ str , $ this -> content_length )...
Get the raw content as a string
228,445
public function getParsedContent ( ) { $ filetype = FileType :: getExtension ( $ this -> content_type ) ; if ( empty ( $ filetype ) ) throw new ParseException ( "Unknown content type" ) ; $ filename = "content." . $ filetype ; $ reader = ReaderFactory :: factory ( $ filename ) ; $ parsed = $ reader -> readFileHandle ( ...
Return the parsed content . The FileFormats readers will be used to parse the data and store it in a dictionary .
228,446
public function configurationObjectAfter ( GetConfigurationObjectDTO $ serviceDataTransferObject ) { $ this -> delay ( self :: PRIORITY_SAVE_OBJECTS_WITH_PARENTS_PATHS , function ( GetConfigurationObjectDTO $ serviceDataTransferObject ) { if ( false === empty ( $ this -> objectsWithParentsPaths ) ) { $ serviceDataTrans...
This function will first save the entire storage of properties paths set in the function objectConversionAfter .
228,447
protected function insertParents ( $ entity , array $ path , array $ parents ) { $ propertyName = reset ( $ path ) ; $ propertyValue = Core :: get ( ) -> getObjectService ( ) -> getObjectProperty ( $ entity , $ propertyName ) ; if ( 1 === count ( $ path ) ) { if ( is_object ( $ propertyValue ) && Core :: get ( ) -> get...
Internal function to fill the parents .
228,448
public function import ( $ input ) { if ( is_array ( $ input ) ) { $ this -> fromArray ( $ input ) ; } else { $ this -> fromString ( $ input ) ; } return $ this ; }
Import the given input
228,449
public function toArray ( ) { $ qs = $ this -> query instanceof QueryString ? $ this -> query -> toString ( ) : '' ; return array ( 'scheme' => $ this -> scheme , 'host' => $ this -> host , 'port' => $ this -> port , 'user' => $ this -> user , 'pass' => $ this -> pass , 'path' => $ this -> path , 'basename' => $ this -...
Convert to an array
228,450
public function toString ( ) { $ result = "" ; if ( ! empty ( $ this -> scheme ) ) { $ result .= "{$this->scheme}://" ; } if ( ! empty ( $ this -> user ) ) { $ result .= ! empty ( $ this -> pass ) ? "{$this->user}:{$this->pass}@" : "{$this->user}@" ; } $ result .= $ this -> host ; if ( ! empty ( $ this -> port ) && ( i...
Convert to a string .
228,451
protected function buildPath ( ) { $ this -> basename = $ this -> filename ; if ( ! empty ( $ this -> extension ) ) { $ this -> basename .= '.' . $ this -> extension ; } $ this -> path = $ this -> dirname ; if ( ! empty ( $ this -> basename ) ) { $ this -> path .= '/' . $ this -> basename ; } return $ this ; }
Rebuild the path using the path components
228,452
protected function fromArray ( $ array ) { if ( empty ( $ array ) ) { return $ this ; } $ this -> query = new QueryString ( ) ; if ( ! empty ( $ array [ 'query' ] ) ) { $ this -> query -> import ( $ array [ 'query' ] ) ; } $ keys = array ( 'scheme' , 'host' , 'port' , 'user' , 'pass' , 'path' , 'fragment' , 'dirname' ,...
Import from an array
228,453
protected function fromString ( $ uri ) { if ( empty ( $ uri ) ) { return $ this ; } $ this -> fromArray ( parse_url ( $ uri ) ) ; return $ this ; }
Import from a string
228,454
protected function parsePath ( $ path = null ) { $ this -> dirname = '' ; $ this -> basename = '' ; $ this -> extension = '' ; $ this -> filename = '' ; if ( empty ( $ path ) ) { return $ this ; } $ parts = pathinfo ( $ path ) ; if ( isset ( $ parts [ 'dirname' ] ) ) { $ this -> dirname = rtrim ( $ parts [ 'dirname' ] ...
Extract the path components from the current path
228,455
public function withLevel ( $ level ) { if ( ! isset ( self :: $ levels [ $ level ] ) ) { throw new InvalidArgumentException ( 'Unsupported log level "' . $ level . '"' ) ; } $ this -> level = $ level ; }
Set log level for logger
228,456
public static function validateURI ( $ uri ) { if ( ! empty ( trim ( $ uri ) ) ) { return filter_var ( trim ( $ uri ) , FILTER_VALIDATE_URL ) ; } return false ; }
Validates that a URI is valid
228,457
protected function doExecuteActions ( $ method , array $ actionManagers ) { $ actions = array ( 'post' => array ( ) , 'notExecuted' => array ( ) ) ; $ this -> executeFailedActions ( $ method ) ; if ( 0 !== count ( $ actionManagers ) ) { $ actions = $ this -> execute ( $ method , $ actionManagers ) ; if ( ! empty ( $ ac...
Executes the given method defined by the given ActionsManager
228,458
protected function executeFailedActions ( $ action ) { $ fileName = $ this -> basePath . '/.' . $ action ; if ( file_exists ( $ fileName ) ) { $ actionManagers = $ this -> decode ( $ fileName ) ; $ actions = $ this -> execute ( $ action , $ actionManagers ) ; $ this -> writeFailedActions ( '.' . $ action , $ actions [ ...
Executes the failed action
228,459
protected function execute ( $ method , array $ actionManagers ) { $ actions = array ( 'post' => array ( ) , 'notExecuted' => array ( ) ) ; foreach ( $ actionManagers as $ bundleName => $ actionManager ) { $ this -> actionManagerGenerator -> generate ( $ actionManager ) ; $ actionManagerClass = $ this -> actionManagerG...
Executes the actions
228,460
protected function writePostActions ( $ fileName , array $ actions ) { $ fileName = $ this -> basePath . '/' . $ fileName ; $ this -> encode ( $ fileName , $ actions ) ; }
Writes the post actions file
228,461
protected function writeFailedActions ( $ fileName , $ actions ) { $ fileName = $ this -> basePath . '/' . $ fileName ; $ this -> filesystem -> remove ( $ fileName ) ; if ( ! empty ( $ actions ) ) $ this -> encode ( $ fileName , $ actions ) ; }
Writes the failed actions file
228,462
protected function validateSignature ( ) { $ check = [ ] ; foreach ( $ this -> data as $ key => $ value ) { if ( $ key !== 'brq_signature' ) { $ check [ $ key ] = $ value ; } } $ signature = new Signature ( $ check , $ this -> secretKey ) ; if ( empty ( $ this -> data [ 'brq_signature' ] ) || ( string ) $ signature !==...
Validate the transaction .
228,463
public function input ( $ key = null , $ default = null ) { $ input = $ this -> getInputSource ( ) ; return $ this -> inputSift ( $ input , $ key , $ default ) ; }
Retrieves an input .
228,464
protected function transform ( $ data , $ hypertextRoutes = [ ] ) { $ links = $ this -> getHypertextJson ( $ hypertextRoutes ) ; if ( $ links && is_array ( $ data ) ) { $ data [ '_links' ] = $ links ; } elseif ( $ links && ! is_array ( $ data ) ) { $ data = [ $ data , '_links' => $ links ] ; } return json_encode ( $ da...
Transforms the data into a json response .
228,465
private function getHypertextJson ( $ routes = [ ] ) { if ( ! $ routes ) { return false ; } $ links = [ ] ; foreach ( $ routes as $ name => $ route ) { $ links [ ] = [ 'rel' => $ name , 'href' => $ route ] ; } return $ links ; }
Transforms the hypertext routes into an array for the json string .
228,466
public function filterLoad ( AssetInterface $ asset ) { static $ format = <<<'EOF'#!/usr/bin/env rubyrequire %s%soptions = { :load_path => [], :source_files => [%s], :expand_paths => false }%ssecretary = Sprockets::Secretary.new(options)secretary.install_assets if options[:asset_root]print sec...
Hack around a bit get the job done .
228,467
private function strposArray ( $ haystack , $ needles ) { if ( is_array ( $ needles ) ) { foreach ( $ needles as $ needle ) { if ( ( $ strpos = strpos ( $ haystack , $ needle ) ) !== false ) { return $ strpos ; } } } return false ; }
Find the position of the first occurrence of any of several substrings in a string
228,468
public function load ( $ test = true ) { $ missingTables = false ; if ( $ test ) { $ missingTables = $ this -> test ( ) ; } if ( ! $ test || ( $ test && $ missingTables !== false ) ) { foreach ( explode ( ';' , $ this -> schema ) as $ query ) { if ( ! empty ( trim ( $ query ) ) ) { if ( ! $ test || $ this -> strposArra...
Load the schema into the database
228,469
public function assertEmail ( $ subject , $ address ) { $ message = $ this -> getMailCatcherClient ( ) -> searchOne ( [ Message :: SUBJECT_CRITERIA => $ subject , Message :: TO_CRITERIA => $ address ] ) ; if ( is_null ( $ message ) ) { throw new Exception ( "Message not found." ) ; } }
Check for email .
228,470
protected function getQueryBuilder ( $ alias = null , $ indexBy = null ) { $ qb = $ this -> traitGetQueryBuilder ( $ alias , $ indexBy ) ; $ alias = $ alias ? : $ this -> getAlias ( ) ; return $ qb -> addSelect ( 'translation' ) -> leftJoin ( $ alias . '.translations' , 'translation' ) ; }
Returns the singe result query builder .
228,471
protected function getCollectionQueryBuilder ( $ alias = null , $ indexBy = null ) { $ qb = $ this -> traitGetCollectionQueryBuilder ( $ alias , $ indexBy ) ; $ alias = $ alias ? : $ this -> getAlias ( ) ; return $ qb -> addSelect ( 'translation' ) -> leftJoin ( $ alias . '.translations' , 'translation' ) ; }
Returns the collection query builder .
228,472
public function createNew ( ) { $ resource = $ this -> traitCreateNew ( ) ; if ( ! $ resource instanceof TranslatableInterface ) { throw new \ InvalidArgumentException ( 'Resource must implement TranslatableInterface.' ) ; } $ resource -> setCurrentLocale ( $ this -> localeProvider -> getCurrentLocale ( ) ) ; $ resourc...
Returns a new resource instance .
228,473
public function getUserEndorsement ( $ user ) { return $ this -> endorsements -> filter ( function ( $ e ) use ( $ user ) { return $ e -> getUser ( ) == $ user ; } ) -> first ( ) ; }
Get the current endorsement for a specific user_id
228,474
public function validate ( array $ credentials = [ ] ) { $ credentials = [ $ this -> storageKey => $ credentials [ $ this -> inputKey ] ] ; if ( $ this -> auth -> retrieveByCredentials ( $ credentials ) ) return true ; return false ; }
Validate a acct s credentials .
228,475
protected function _createInternalException ( $ message = null , $ code = null , $ previous = null ) { return new InternalException ( $ message , $ code , $ previous ) ; }
Creates a new Internal exception .
228,476
public function encompasses ( DateTimeRange $ otherRange ) : bool { return $ this -> start -> comesBeforeOrEqual ( $ otherRange -> start ) && $ this -> end -> comesAfterOrEqual ( $ otherRange -> end ) ; }
Returns whether the supplied date time range is encompassed by this date time range .
228,477
public function method ( ) { $ emulated = filter_input ( INPUT_GET , '_method' , FILTER_SANITIZE_STRING ) ; if ( ! $ emulated ) { $ emulated = filter_input ( INPUT_POST , '_method' , FILTER_SANITIZE_STRING ) ; } if ( $ this -> app -> config ( 'request.emulate' ) && $ emulated ) { return $ emulated ; } return $ _SERVER ...
Retrieves the request method
228,478
public function token ( ) { $ inputs = $ this -> getInputs ( ) ; $ headers = $ this -> headers ( ) ; if ( isset ( $ headers [ 'X-Auth-Token' ] ) ) { return $ headers [ 'X-Auth-Token' ] ; } if ( isset ( $ inputs [ 'token' ] ) ) { return $ inputs [ 'token' ] ; } return false ; }
Retrieves the token
228,479
public function input ( $ input = null , $ default = null ) { $ inputs = array_merge ( $ this -> getInputs ( ) , $ this -> additionalInputs ) ; foreach ( $ inputs as $ key => $ value ) { if ( in_array ( $ key , $ this -> reserved ) ) { unset ( $ inputs [ $ key ] ) ; } } if ( $ input ) { return isset ( $ inputs [ $ inpu...
Returns a request input
228,480
public function file ( $ input = null ) { if ( ! isset ( $ input ) || ! isset ( $ _FILES [ $ input ] ) ) { throw new \ InvalidArgumentException ( 'Invalid file' , 400 ) ; } return $ _FILES [ $ input ] ; }
Gets a request file
228,481
public function storeFile ( $ input = null , $ target ) { if ( ! isset ( $ input ) || ! isset ( $ target ) ) { throw new \ InvalidArgumentException ( 'Undefined input name or target' , 400 ) ; } $ result = move_uploaded_file ( $ _FILES [ $ input ] [ 'tmp_name' ] , $ target ) ; if ( ! $ result ) { throw new \ InvalidArg...
Stores a request file
228,482
private function getInputs ( ) { if ( $ this -> inputs ) { return $ this -> inputs ; } if ( isset ( $ _SERVER [ 'CONTENT_TYPE' ] ) && strpos ( $ _SERVER [ 'CONTENT_TYPE' ] , 'application/json' ) === 0 ) { $ input = file_get_contents ( 'php://input' ) ; $ decoded = json_decode ( $ input , true ) ; if ( $ decoded ) { $ t...
Stores the parameters from the request in the inputs array
228,483
public function getSdkCommand ( $ parameters = [ ] ) { return $ this -> injectMiddleware ( $ this -> dm -> getClient ( ) -> getCommand ( static :: $ sdkName , array_merge ( $ this -> parameters , $ parameters ) ) ) ; }
Return the prepared AWS SDK Command object to be executed .
228,484
private function getReferredParentId ( $ customerId ) { $ result = $ customerId ; $ area = $ this -> state -> getAreaCode ( ) ; if ( $ area == \ Magento \ Framework \ App \ Area :: AREA_ADMINHTML ) { $ defRootMlmId = $ this -> hlpConfig -> getReferralsRootAnonymous ( ) ; $ parent = $ this -> daoDwnlCust -> getByMlmId (...
Analyze referral code and get parent for the customer if parent ID was missed in request .
228,485
public function getParameter ( $ name ) { if ( array_key_exists ( $ name , $ this -> parameters ) ) { return $ this -> parameters [ $ name ] ; } if ( func_num_args ( ) > 1 ) { return func_get_arg ( 1 ) ; } throw new ContextParamNotFoundException ( sprintf ( 'Container parameter "%s" was not found' , $ name ) ) ; }
Get the value of the given parameter .
228,486
public function bind ( $ typeName ) { if ( $ this -> proxyTypes !== NULL ) { $ this -> proxyTypes = NULL ; } $ key = strtolower ( $ typeName ) ; switch ( $ key ) { case 'koolkode\config\configuration' : case 'koolkode\context\containerinterface' : case 'koolkode\context\exposedcontainerinterface' : case 'koolkode\conte...
Create a binding for the given type the binding is registered in the builder and will be bound by the created DI container binding multiple times to the same type will modify the existing binding instead of creating a new binding!
228,487
public function getProxyBindings ( ) { if ( $ this -> proxyTypes === NULL ) { $ this -> proxyTypes = [ ] ; foreach ( $ this -> bindings as $ binding ) { $ scope = $ binding -> getScope ( ) ; if ( $ scope === NULL ) { continue ; } if ( Singleton :: class == $ scope ) { continue ; } $ this -> proxyTypes [ strtolower ( $ ...
Get all bindings that require a scope proxy .
228,488
public function subQuery ( $ table , $ alias = null ) { $ sub = new self ( ) ; if ( ! $ alias ) $ alias = 'sub_' . $ this -> subQueryCount ++ ; $ sub -> table ( $ table , $ alias ) ; $ sub -> setParentTable ( $ this -> getAliasOrTable ( ) ) ; return $ sub ; }
return a new Sql|Query object as sub - query .
228,489
public function value ( $ name , $ value = null ) { if ( is_array ( $ name ) ) { $ this -> values += $ name ; } elseif ( func_num_args ( ) > 1 ) { $ this -> values [ $ name ] = $ value ; } return $ this ; }
set values for insert or update .
228,490
public function handleAddAcl ( string $ role , string $ resource = null , string $ privilege = null ) { $ idRole = $ this -> identityAuthorizator -> getIdRoleByName ( $ role ) ; $ idResource = null ; if ( $ resource ) { $ idResource = $ this -> identityAuthorizator -> getIdResourceByName ( $ resource ) ; } $ idPrivileg...
Handle add acl .
228,491
public static function all ( $ locale = null ) { return static :: keys ( ) -> mapWithKeys ( function ( $ key ) use ( $ locale ) { return [ $ key => trans ( "blog::posts.statuses.{$key}" , [ ] , $ locale ) ] ; } ) ; }
Get all posts status
228,492
public static function get ( $ key , $ default = null , $ locale = null ) { return self :: all ( $ locale ) -> get ( $ key , $ default ) ; }
Get a post status .
228,493
public function renderMedia ( MediaInterface $ media , array $ params = [ ] ) { switch ( $ media -> getType ( ) ) { case MediaTypes :: VIDEO : return $ this -> renderVideo ( $ media , $ params ) ; case MediaTypes :: FLASH : return $ this -> renderFlash ( $ media , $ params ) ; case MediaTypes :: AUDIO : return $ this -...
Renders the media .
228,494
public function renderVideo ( MediaInterface $ video , array $ params = [ ] ) { if ( $ video -> getType ( ) !== MediaTypes :: VIDEO ) { throw new \ InvalidArgumentException ( 'Expected media with "video" type.' ) ; } $ params = array_merge ( [ 'responsive' => false , 'aspect_ratio' => '16by9' , 'attr' => [ 'id' => 'med...
Renders the video .
228,495
public function renderFlash ( MediaInterface $ flash , array $ params = [ ] ) { if ( $ flash -> getType ( ) !== MediaTypes :: FLASH ) { throw new \ InvalidArgumentException ( 'Expected media with "flash" type.' ) ; } $ params = array_merge ( [ 'attr' => [ 'id' => 'media-flash-' . $ flash -> getId ( ) , 'class' => 'swf-...
Renders the flash swf .
228,496
public function renderAudio ( MediaInterface $ audio , array $ params = [ ] ) { if ( $ audio -> getType ( ) !== MediaTypes :: AUDIO ) { throw new \ InvalidArgumentException ( 'Expected media with "audio" type.' ) ; } $ params = array_merge ( [ 'attr' => [ 'id' => 'media-audio-' . $ audio -> getId ( ) , ] , ] , $ params...
Renders the audio .
228,497
public function getIsSingleIterator ( ) { $ iter = $ this -> CloneInstance ( ) ; $ part1 = $ iter -> MoveNext ( ) ; if ( $ part1 ) { $ part2 = ! $ iter -> MoveNext ( ) ; if ( $ part2 ) return true ; } return false ; }
Check to see if the iterator has just one item
228,498
public function init ( ) { if ( ! $ this -> serviceContainer -> isRegistered ( ServiceContainer :: SERVICE_LOGGER ) || ! ( $ this -> getLogger ( ) instanceof LoggerInterface ) ) { $ this -> setService ( ServiceContainer :: SERVICE_LOGGER , new NullLogger ( ) ) ; } $ this -> getControllerDispatcher ( ) -> setLogger ( $ ...
Initialize application before execution
228,499
public function run ( Request $ request = null ) { $ this -> init ( ) ; $ this -> getLogger ( ) -> debug ( 'Application launched' ) ; if ( ! ( $ request instanceof Request ) ) { $ appMode = $ this -> detectRunMode ( ) ; if ( $ appMode == self :: MODE_WEB ) { $ request = Request \ Web :: makeFromGlobals ( ) ; } else { $...
Run Application and output content