idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
54,600
public function PrependExternal ( $ path = '' , $ async = FALSE , $ defer = FALSE , $ doNotMinify = FALSE ) { return $ this -> Prepend ( $ path , $ async , $ defer , $ doNotMinify , TRUE ) ; }
Prepend script before all group scripts for later render process with downloading external content
54,601
public function OffsetExternal ( $ index = 0 , $ path = '' , $ async = FALSE , $ defer = FALSE , $ doNotMinify = FALSE ) { return $ this -> Offset ( $ index , $ path , $ async , $ defer , $ doNotMinify , TRUE ) ; }
Add script into given index of scripts group array for later render process with downloading external content
54,602
public function Append ( $ path = '' , $ async = FALSE , $ defer = FALSE , $ doNotMinify = FALSE , $ external = FALSE ) { $ item = $ this -> _completeItem ( $ path , $ async , $ defer , $ doNotMinify , $ external ) ; $ actialGroupItems = & $ this -> _getScriptsGroupContainer ( $ this -> actualGroupName ) ; array_push (...
Append script after all group scripts for later render process
54,603
public function Prepend ( $ path = '' , $ async = FALSE , $ defer = FALSE , $ doNotMinify = FALSE , $ external = FALSE ) { $ item = $ this -> _completeItem ( $ path , $ async , $ defer , $ doNotMinify , $ external ) ; $ actualGroupItems = & $ this -> _getScriptsGroupContainer ( $ this -> actualGroupName ) ; array_unshi...
Prepend script before all group scripts for later render process
54,604
public function Offset ( $ index = 0 , $ path = '' , $ async = FALSE , $ defer = FALSE , $ doNotMinify = FALSE , $ external = FALSE ) { $ item = $ this -> _completeItem ( $ path , $ async , $ defer , $ doNotMinify , $ external ) ; $ actialGroupItems = & $ this -> _getScriptsGroupContainer ( $ this -> actualGroupName ) ...
Add script into given index of scripts group array for later render process
54,605
private function _isDuplicateScript ( $ path ) { $ result = '' ; $ allGroupItems = & self :: $ scriptsGroupContainer [ $ this -> getCtrlActionKey ( ) ] ; foreach ( $ allGroupItems as $ groupName => $ groupItems ) { foreach ( $ groupItems as $ item ) { if ( $ item -> path == $ path ) { $ result = $ groupName ; break ; }...
Is the linked script duplicate?
54,606
public function Render ( $ indent = 0 ) { $ actualGroupItems = & $ this -> _getScriptsGroupContainer ( $ this -> actualGroupName ) ; if ( count ( $ actualGroupItems ) === 0 ) return '' ; $ minify = ( bool ) self :: $ globalOptions [ 'jsMinify' ] ; $ joinTogether = ( bool ) self :: $ globalOptions [ 'jsJoin' ] ; if ( $ ...
Render script elements as html code with links to original files or temporary downloaded files
54,607
private function _downloadFileToTmpAndGetNewHref ( $ item , $ minify = FALSE ) { $ path = $ item -> path ; $ tmpFileFullPath = $ this -> getTmpDir ( ) . '/external_js_' . md5 ( $ path ) . '.js' ; if ( self :: $ fileRendering ) { if ( file_exists ( $ tmpFileFullPath ) ) { $ cacheFileTime = filemtime ( $ tmpFileFullPath ...
Download js file by path and store result in tmp directory and return new href value
54,608
private function _getPossiblyRedirectedPath ( $ path = '' ) { $ fp = fopen ( $ path , 'r' ) ; $ metaData = stream_get_meta_data ( $ fp ) ; foreach ( $ metaData [ 'wrapper_data' ] as $ response ) { if ( strtolower ( substr ( $ response , 0 , 10 ) ) == 'location: ' ) { $ path = substr ( $ response , 10 ) ; } } return $ p...
If there is any redirection in external content path - get redirect path
54,609
private function _renderItemSeparated ( \ stdClass $ item ) { $ result = '<script type="text/javascript"' ; if ( $ item -> async ) $ result .= ' async="async"' ; if ( $ item -> async ) $ result .= ' defer="defer"' ; if ( ! $ item -> external && self :: $ fileChecking ) { $ fullPath = $ this -> getAppRoot ( ) . $ item -...
Create HTML script element from data item
54,610
public function createDecorator ( $ decorable , $ templateTypeName = null ) { if ( $ decorable instanceof ContentInterface ) { return new ImmutableDecorator ( $ decorable , $ this -> contentDecorator , $ this -> currentTheme ? : $ this -> themeResolver -> resolve ( ) , $ templateTypeName ) ; } if ( $ decorable instance...
Create and return a DecoratorInterface for given content .
54,611
private function getKeyPath ( Memento \ Key $ key = null ) { $ pathParts = array ( ) ; if ( ! is_null ( $ this -> groupKey ) ) { $ keyFileName = base64_encode ( $ this -> groupKey -> getKey ( ) ) ; $ keyPartition = abs ( crc32 ( $ keyFileName ) ) % Memento \ Engine \ File :: DIR_PARTITION_COUNT ; $ pathParts [ ] = $ ke...
Gets the path to the key Can return group path key path or group path + key path
54,612
private function getExpiresPath ( Memento \ Key $ key = null ) { return $ this -> getKeyPath ( $ this -> groupKey ? null : $ key ) ; }
Gets the path to the expires file Returns group path if possible . Otherwise returns key path
54,613
private function getTtlPath ( Memento \ Key $ key = null ) { return $ this -> getKeyPath ( $ this -> groupKey ? null : $ key ) ; }
Gets the path to the ttl file Returns group path if possible . Otherwise returns key path
54,614
private function rrmdir ( $ dir ) { if ( 0 !== strpos ( $ dir , $ this -> storagePath ) ) { return false ; } foreach ( glob ( $ dir . DIRECTORY_SEPARATOR . '*' ) as $ file ) { if ( is_dir ( $ file ) ) { $ this -> rrmdir ( $ file ) ; } else { unlink ( $ file ) ; } } return rmdir ( $ dir ) ; }
Recursively removes a directory
54,615
public function terminate ( Memento \ Key $ key = null ) { $ keyPath = $ this -> getKeyPath ( $ key ) ; return $ this -> rrmdir ( $ keyPath ) ; }
Duplicate of the invalidate command
54,616
private function filesWithFullPaths ( $ dir , $ include_hidden = true , $ recursive = false ) { $ dir = $ this -> withSlash ( $ dir ) ; $ result = [ ] ; if ( $ dirstream = opendir ( $ dir ) ) { while ( false !== ( $ filename = readdir ( $ dirstream ) ) ) { $ path = $ dir . $ filename ; if ( $ filename != '.' && $ filen...
Return a list of files from a directory .
54,617
private function deleteDirByFullPath ( $ path , $ delete_self = true , array $ exclude = [ ] ) { $ dir = $ this -> withSlash ( $ path ) ; if ( $ dh = opendir ( $ dir ) ) { while ( $ file = readdir ( $ dh ) ) { if ( ( $ file != '.' ) && ( $ file != '..' ) ) { $ fullpath = $ dir . $ file ; if ( ! $ delete_self && in_arra...
Delete directory by full path .
54,618
static function name ( $ ref ) { return implode ( "_" , array_map ( function ( $ ck , $ cr ) { return preg_replace ( "/_$cr\$/" , "" , $ ck ) ; } , $ ref [ "foreignColumns" ] , $ ref [ "referencedColumns" ] ) ) ; }
Compose an identifying name
54,619
public function getPagedResults ( $ limit = 50 , $ page = 0 ) { $ dql = sprintf ( self :: DQL_GET_USERS , User :: class ) ; return $ this -> getPaginator ( $ dql , $ limit , $ page ) ; }
Get all users paged .
54,620
public function transferDiscounts ( Varien_Object $ salesObject , IDiscountContainer $ discountContainer ) { $ discounts = $ discountContainer -> getDiscounts ( ) ; $ data = $ this -> getDiscountsData ( $ salesObject ) ; foreach ( $ data as $ loneDiscountData ) { $ discount = $ this -> _fillOutDiscount ( $ discounts ->...
Transfer discount data from Mage_Sales_Model_Order_Addresses to IDiscountContainer .
54,621
protected function _fillOutDiscount ( IDiscount $ discountPayload , array $ discountData ) { return $ discountPayload -> setAmount ( $ this -> _nullCoalesce ( $ discountData , 'amount' , 0.00 ) ) -> setAppliedCount ( $ this -> _nullCoalesce ( $ discountData , 'applied_count' , null ) ) -> setCode ( $ this -> _nullCoale...
Fill out the data in an IDiscount
54,622
public function transferTaxDiscounts ( Varien_Object $ salesObject , ITaxDiscountContainer $ discountContainer ) { $ discounts = $ discountContainer -> getDiscounts ( ) ; $ data = $ this -> getDiscountsData ( $ salesObject ) ; foreach ( $ data as $ loneDiscountData ) { $ discount = $ this -> _fillOutTaxDiscount ( $ dis...
Transfer discount data from Mage_Sales_Model_Qoute_Addresses or Mage_Sales_Model_Quote_Items to TaxDutyFee \ IDiscountContainer .
54,623
public function transferInvoiceTaxDiscounts ( Varien_Object $ salesObject , ITaxedDiscountContainer $ discountContainer ) { $ discounts = $ discountContainer -> getDiscounts ( ) ; $ itemC = Mage :: getModel ( 'sales/order_item' ) -> getCollection ( ) -> addFieldToFilter ( 'item_id' , array ( 'eq' => $ salesObject -> ge...
Transfer discount data from Mage_Sales_Model_Qoute_Addresses or Mage_Sales_Model_Quote_Items to TaxDutyFee \ ITaxedDiscountContainer .
54,624
protected function _fillOutTaxDiscount ( ITaxDiscount $ discountPayload , array $ discountData ) { return $ discountPayload -> setAmount ( $ this -> _nullCoalesce ( $ discountData , 'amount' , null ) ) -> setId ( $ this -> _nullCoalesce ( $ discountData , 'id' , null ) ) ; }
Fill out the data in an ITaxDiscount
54,625
public function setPost ( $ spec , $ value = null ) { if ( ( null === $ value ) && ! is_array ( $ spec ) ) { throw new \ Exception ( 'Invalid value passed to setPost(); must be either array of values or key/value pair' ) ; } if ( ( null === $ value ) && is_array ( $ spec ) ) { foreach ( $ spec as $ key => $ value ) { $...
Set POST values
54,626
public function getRawBody ( ) { if ( null === $ this -> _rawBody ) { $ body = file_get_contents ( 'php://input' ) ; if ( strlen ( trim ( $ body ) ) > 0 ) { $ this -> _rawBody = $ body ; } else { $ this -> _rawBody = false ; } } return $ this -> _rawBody ; }
Return the raw body of the request if present
54,627
private function bindApplicationEvent ( ServiceDefinition $ application , string $ event , string $ class , string $ property , string $ argument = null ) : void { $ argument = $ argument ? ', $' . $ argument : '' ; $ application -> addSetup ( sprintf ( '?->?[] = function ($application%s = null) use ($dispatcher) { $di...
Binds dispatcher to Nette \ Application \ Application event .
54,628
public function initDb ( array $ connections ) : void { $ this -> db = new Database ( ) ; foreach ( $ connections as $ name => $ settings ) { $ this -> db -> addConnection ( $ settings , $ name ) ; } }
Prepares the database interaction
54,629
public function load ( bool $ debug = false ) : void { $ this -> app = new Slim ( [ 'settings' => [ 'displayErrorDetails' => $ debug ] ] ) ; if ( ! $ debug ) { Error :: registerSystemErrors ( $ this -> app ) ; } $ this -> buildRoutes ( ) ; }
Loads the main routing framework and builds the application routes
54,630
private function buildRoutes ( ) : void { require_once 'System.php' ; System :: reflectionRoutes ( $ this , $ this -> app ) ; foreach ( $ this -> types as $ type ) { $ type -> applyRoutes ( $ this , $ this -> app ) ; } }
Adds all routes to the System
54,631
public function addValidation ( string $ name , string $ validation ) : void { $ this -> validations [ $ name ] = $ validation ; }
Adds a new validation option to the application
54,632
public function addCalculator ( string $ name , string $ validation ) : void { $ this -> calculators [ $ name ] = $ validation ; }
Adds a new calculator option to the application
54,633
public function addFilter ( string $ name , string $ filter ) : void { $ this -> filters [ $ name ] = $ filter ; }
Adds a new Filter option to the application
54,634
public function addMiddleware ( string $ name , string $ middleware ) : void { $ this -> middleware [ $ name ] = $ middleware ; }
Adds a new Middleware option to the application
54,635
public function addRoute ( string $ type , string $ name , string $ route ) : void { if ( ! isset ( $ this -> routes [ $ name ] ) ) { $ this -> routes [ $ name ] = [ ] ; } $ this -> routes [ $ name ] [ $ type ] = $ route ; }
Adds a new Route option to the application
54,636
public function getRoute ( string $ type , string $ name ) : string { return $ this -> routes [ $ name ] [ $ type ] ; }
Returns the classname of the given Route option
54,637
public function addType ( string $ name , string $ type ) : void { $ this -> types [ $ name ] = new Type ( $ type ) ; }
Add a content type to the CDL System
54,638
public function addMigration ( string $ path , Migration $ migrations ) : void { $ name = basename ( $ path ) ; $ this -> migrations [ $ name ] = $ migrations ; }
Adds a new Migration option to the application
54,639
protected function _setNamespaceFromGetters ( array $ gettersNamespaces ) { ( $ this -> _c__namespace ) ? : $ this -> _c__namespace = $ this -> namespace ; $ this -> setNamespace ( $ gettersNamespaces ) ; $ this -> namespace_getter = array ( ) ; return $ this ; }
Set Namespace From Getters - save current namespace state - reset getters namespace state - set namespace to getters
54,640
public function onKernelRequest ( GetResponseEvent $ event ) { $ request = $ event -> getRequest ( ) ; $ route = $ this -> router -> getRouteCollection ( ) -> get ( $ request -> attributes -> get ( '_route' ) ) ; if ( ! $ route || ! $ themeOptions = $ route -> getOption ( 'synapse_theme' ) ) { return ; } $ request -> a...
kernel . request event handler .
54,641
public function handleContextAnnotation ( $ e ) { $ annotation = $ e -> getParam ( 'annotation' ) ; if ( ! $ annotation instanceof Annotation \ Context ) { return ; } $ spec = $ e -> getParam ( $ this -> getEventParamName ( ) ) ; $ spec [ 'contexts' ] = $ annotation -> getContext ( ) ; }
Handle context annotation
54,642
public function execute ( ) { if ( ! $ this -> preExecute ( $ this ) ) { return ; } $ limit = $ this -> datasourceQuery -> getLimit ( ) ; $ offset = $ this -> datasourceQuery -> getOffset ( ) ; $ this -> totalCount = ( int ) $ this -> getCountQuery ( ) -> execute ( ) -> fetchField ( ) ; $ this -> range ( $ offset , $ l...
Override the execute method .
54,643
public function setAuthors ( array $ authors ) { if ( count ( $ authors ) == 0 ) { return ; } foreach ( $ authors as $ author ) { $ this -> authors [ ] = ( object ) $ author ; } return $ this ; }
Sets the package authors .
54,644
public static function parseVendorAndPackage ( $ templateName ) { if ( $ templateName !== null ) { $ nameParts = explode ( '/' , $ templateName ) ; if ( count ( $ nameParts ) == 2 ) { if ( strlen ( $ nameParts [ 0 ] ) > 0 && strlen ( $ nameParts [ 1 ] ) > 0 ) { return $ nameParts ; } } } throw new InvalidArgumentExcept...
Parses the package and vendor names .
54,645
public static function getConfiguredPackage ( ) { $ package = new Package ; $ package -> setLicense ( user_config ( 'configuration.license' ) ) ; $ package -> setAuthors ( user_config ( 'configuration.authors' ) ) ; return $ package ; }
Returns a new Package instance configured with user preferences .
54,646
public static function fromArray ( array $ array , $ strict = true ) { $ details = ( object ) $ array ; $ packageNameDetails = self :: parseVendorAndPackage ( object_get ( $ details , 'name' , null ) ) ; $ description = object_get ( $ details , 'description' , null ) ; $ license = object_get ( $ details , 'license' , n...
Returns a new package instance from the provided array .
54,647
public static function fromFile ( $ path , $ strict = true ) { if ( file_exists ( $ path ) ) { return self :: fromArray ( json_decode ( file_get_contents ( $ path ) , true ) , $ strict ) ; } else { return new Package ; } }
Returns a new package instance from the provided file .
54,648
public function toJson ( ) { $ packageDetails = new \ stdClass ; $ packageDetails -> name = $ this -> getName ( ) ; $ packageDetails -> description = $ this -> getDescription ( ) ; $ packageDetails -> license = $ this -> getLicense ( ) ; $ packageDetails -> authors = $ this -> getAuthors ( ) ; return json_encode ( $ pa...
Converts the package details into JSON .
54,649
public function setGeometry ( Geometry $ geometry = null , bool $ stopPropagation = false ) { $ this -> geometry = $ geometry ; if ( $ stopPropagation ) { $ this -> stopPropagation ( ) ; } }
Sets the newly constructed Geometry object .
54,650
public static function loadDotFile ( $ path ) { $ file = file_get_contents ( $ path ) ; if ( $ file === false ) { return null ; } $ file = str_replace ( "\r" , "\n" , $ file ) ; $ file = str_replace ( "\n\n" , "\n" , $ file ) ; $ lines = explode ( "\n" , $ file ) ; $ data = [ ] ; $ lineCount = count ( $ lines ) ; for (...
Loads the . bitrank file if there is one .
54,651
public static function getProjectRoot ( ) { $ sep = DIRECTORY_SEPARATOR ; $ pos = strrpos ( __DIR__ , "${sep}vendor${sep}" ) ; if ( $ pos === false ) { return null ; } $ projectRoot = substr ( __DIR__ , 0 , $ pos ) ; return $ projectRoot ; }
Gets the project root directory if possible .
54,652
public function update ( ) { $ item = $ this -> cache -> getItem ( "io.bitrank.$this->cacheHandle.init-data" ) ; $ init_data = $ item -> get ( ) ; if ( $ item -> isMiss ( ) ) { if ( $ this -> getTestParam ( 'cache-must-hit' ) ) { throw new \ Exception ( "Cache did not hit" ) ; } $ item -> lock ( ) ; if ( $ this -> requ...
Updates the initialisation data for flags scores and locale .
54,653
private function processHttpResponse ( $ response ) { $ statusCode = $ response -> getStatusCode ( ) ; switch ( $ statusCode ) { case 200 : break ; case 404 : break ; case 400 : throw new Exception \ ClientRequestException ( "The server rejected our request. Are you using a deprecated version of the BitRank PHP client?...
Process HTTP request codes
54,654
private function retrieveInitData ( ) { try { $ response = $ this -> client -> request ( 'GET' , "/v2/init-data/$this->locale" , $ this -> authHeaders ) ; $ this -> processHttpResponse ( $ response ) ; } catch ( \ GuzzleHttp \ Exception \ TransferException $ tex ) { throw new Exception \ ConnectionFailedException ( 'Fa...
Retrieve init data from the server .
54,655
private function requestScore ( $ addressBase58 ) { try { if ( $ this -> requestStartTime == 0 ) { $ this -> requestStartTime = microtime ( true ) ; } $ response = $ this -> client -> request ( 'GET' , "/v2/address/$addressBase58/score" , $ this -> authHeaders ) ; } catch ( RequestException $ rex ) { throw new Exceptio...
Makes a generic score request to the API and returns the data for further processing .
54,656
public function score ( $ addressBase58 ) { $ response = $ this -> requestScore ( $ addressBase58 ) ; $ seen = $ response [ 0 ] ; $ body = json_decode ( $ response [ 1 ] , true ) ; return new Score ( $ this , $ addressBase58 , $ body , $ seen ) ; }
Retrieves the BitRank score of the address you are requesting .
54,657
public function getLocaleString ( $ key ) { $ level = & $ this -> localeData ; $ keys = explode ( '.' , $ key ) ; foreach ( $ keys as $ key ) { if ( isset ( $ level [ $ key ] ) ) { $ level = & $ level [ $ key ] ; } else { return null ; } } return $ level ; }
Returns a locale string based on the given key .
54,658
public function getFlag ( $ key ) { if ( isset ( $ this -> flags [ $ key ] ) ) { return $ this -> flags [ $ key ] ; } return null ; }
Get a flag by its key
54,659
private function processContentPhaseTwo ( & $ filtered ) { $ filter = $ this -> config [ "textfilter" ] ; $ textFilter = $ this -> di -> get ( "textfilter" ) ; $ new = $ textFilter -> parse ( $ filtered -> text , $ filter ) ; $ filtered -> text = $ new -> text ; $ filtered -> frontmatter = array_merge_recursive_distinc...
Process content phase 2 and merge with new frontmatter into view structure .
54,660
private function getDataForAdditionalRoute ( $ route ) { $ filter = $ this -> config [ "textfilter" ] ; $ textFilter = $ this -> di -> get ( "textfilter" ) ; list ( $ routeIndex , , $ filtered ) = $ this -> mapRoute2Content ( $ route ) ; $ meta = $ this -> getMetaForRoute ( $ route ) ; unset ( $ meta [ "__toc__" ] ) ; ...
Load view data for additional route merged with meta if any .
54,661
private function addBaseurl2AnchorUrls ( & $ filtered , $ baseurl ) { $ textf = $ this -> di -> get ( "textfilter" ) ; $ url = $ this -> di -> get ( "url" ) ; $ request = $ this -> di -> get ( "request" ) ; $ part = $ request -> getRoute ( ) ; $ callback = function ( $ route ) use ( $ url , $ baseurl , $ part ) { if ( ...
Parse text find and update all a href to use baseurl .
54,662
private function addBaseurl2ImageSource ( & $ filtered , $ baseurl ) { $ textf = $ this -> di -> get ( "textfilter" ) ; $ url = $ this -> di -> get ( "url" ) ; $ callback = function ( $ route ) use ( $ url , $ baseurl ) { return $ url -> asset ( $ route , $ baseurl ) ; } ; $ filtered -> text = $ textf -> addBaseurlToIm...
Parse text find and update all image source to use baseurl .
54,663
public function handleTriggerAnnotation ( $ e ) { $ annotation = $ e -> getParam ( 'annotation' ) ; if ( ! $ annotation instanceof Annotation \ Trigger ) { return ; } $ operationSpec = $ e -> getParam ( 'operationSpec' ) ; $ operationSpec [ 'events' ] [ ] = $ annotation -> getEventDescription ( ) ; }
Handle event trigger annotation
54,664
public function handleAliasAnnotation ( $ e ) { $ annotation = $ e -> getParam ( 'annotation' ) ; if ( ! $ annotation instanceof Annotation \ Alias ) { return ; } $ operationSpec = $ e -> getParam ( 'operationSpec' ) ; $ operationSpec [ 'aliases' ] = ( array ) $ annotation -> getAlias ( ) ; }
Handle alias annotation
54,665
public function getFullPath ( $ path = '/' ) { if ( mb_substr ( $ path , 0 , 1 ) == '/' ) { $ path = mb_substr ( $ path , 1 ) ; } $ full_path = $ this -> getSandboxPath ( ) . $ path ; if ( strpos ( $ full_path , '..' ) ) { $ full_path = realpath ( $ full_path ) ; if ( mb_substr ( $ full_path , 0 , $ this -> sandbox_pat...
Convert relative path to full path .
54,666
public static function getBoxHTML ( $ boxContent ) { $ html = '' ; if ( empty ( $ boxContent ) ) return NULL ; $ html .= '<!-- Start_Box ; $ html .= '<div class="box box-info">' ; $ html .= self :: getBoxHeaderHTML ( $ boxContent [ "header" ] ) ; $ html .= '<div class="box-body">' ; $ html .= self :: getTableHTML ( $ ...
Construct HTML for a Box
54,667
public static function getTableHTML ( $ tableData ) { $ html = '' ; if ( empty ( $ tableData ) ) return NULL ; $ html .= '<!-- Start_Table_Responsive ; $ html .= '<div class="table-responsive">' ; $ html .= '<table class="table no-margin">' ; $ html .= '<thead>' ; $ html .= '<tr>' ; foreach ( $ tableData [ "ths" ] as ...
Construct HTML of all tables
54,668
public static function getBoxHeaderHTML ( $ header ) { $ html = '' ; if ( empty ( $ header ) ) return NULL ; $ html .= '<!-- Start_Box_Header ; $ html .= '<div class="box-header with-border">' ; $ html .= '<h3 class="box-title">' . $ header [ "title" ] . '</h3>' ; $ html .= '<div class="box-tools pull-right">' ; $ htm...
Construct HTML for a Box - Header
54,669
public static function getBoxFooterHTML ( $ footer ) { $ html = '' ; if ( empty ( $ footer ) ) return NULL ; $ html .= '<!-- Start_Box_Footer ; $ html .= '<div class="box-footer clearfix">' ; $ html .= '<a href="javascript::;" class="btn btn-sm btn-info btn-flat pull-left">' . $ footer [ "footerLeft" ] . '</a>' ; $ ht...
Construct HTML for a Box - Footer
54,670
public function coreComponents ( ) { return [ 'naming' => [ 'class' => '\cza\base\components\utils\Naming' , ] , 'password' => [ 'class' => '\cza\base\components\utils\Password' , ] , 'folderOrganizer' => [ 'class' => '\cza\base\components\utils\FolderOrganizer' , 'uploadTempPath' => isset ( Yii :: $ app -> params [ 'c...
Returns the configuration of core application components .
54,671
public function getRegularLangName ( $ lang = NULL ) { if ( isset ( $ this -> _data [ 'env' ] [ 'APP_LANG_NAME' ] ) ) { return $ this -> _data [ 'env' ] [ 'APP_LANG_NAME' ] ; } if ( is_null ( $ lang ) ) $ lang = Yii :: $ app -> language ; $ this -> _data [ 'env' ] [ 'ENABLED_LANGS' ] = str_replace ( "-" , "_" , strtolo...
return regular language name eg . zh_cn
54,672
public function getValueByKey ( $ key , $ default = '' , $ class = null ) { if ( null === $ class ) { $ class = $ this -> getEntityClass ( ) ; } $ result = $ this -> getDoctrine ( ) -> getRepository ( $ class ) -> findOneBy ( [ 'key' => $ key , ] ) ; if ( null === $ result ) { return $ default ; } return $ result -> ge...
Get Value By Key
54,673
private function getEntityClass ( ) { foreach ( $ this -> getDoctrineManager ( ) -> getMetadataFactory ( ) -> getAllMetadata ( ) as $ metaData ) { if ( $ metaData -> getName ( ) === Config :: class ) { continue ; } $ reflectionClass = new \ ReflectionClass ( $ metaData -> getName ( ) ) ; if ( true === in_array ( Config...
Get Entity Class
54,674
private function getParentClassNames ( \ ReflectionClass $ reflectionClass ) { $ parentClassNames = [ ] ; while ( $ parent = $ reflectionClass -> getParentClass ( ) ) { $ parentClassNames [ ] = $ parent -> getName ( ) ; $ reflectionClass = $ parent ; } return $ parentClassNames ; }
Get Parent ClassNames
54,675
public function getFileOutput ( $ filename ) { if ( file_exists ( $ filename ) ) { ob_start ( ) ; include ( $ filename ) ; $ content = ob_get_contents ( ) ; ob_end_clean ( ) ; $ this -> logger -> info ( "View parsed - $filename" ) ; } else { $ content = "" ; } return $ content ; }
This method can be used from controller only from Controller . Its main purpose is to get the content of any view .
54,676
public function massAttachTags ( MassAttachRequest $ request ) { $ data = $ request -> only ( [ 'ids' , 'tag_names' ] ) ; foreach ( $ data [ 'ids' ] as $ model_id ) { if ( $ object = $ this -> repository -> find ( $ model_id ) ) { $ object -> attachTags ( $ data [ 'tag_names' ] ) ; } } \ Cache :: tags ( 'response' ) ->...
Mass Attach Tags
54,677
function getColumn ( $ c ) { if ( ! isset ( $ this -> columns [ $ c ] ) ) { throw new \ OutOfBoundsException ( "Unknown column $c" ) ; } return $ this -> columns [ $ c ] ; }
Get a single column
54,678
protected function getWel ( ) { if ( ! is_null ( $ this -> wel ) ) return $ this -> wel ; $ this -> app -> loadDeferredProviders ( ) ; $ this -> wel = ConsoleApplication :: make ( $ this -> app ) ; return $ this -> wel -> boot ( ) ; }
Get the Artisan console instance .
54,679
private function metaTag ( $ name , $ content ) { $ name = htmlspecialchars ( $ name ) ; $ content = htmlspecialchars ( $ content ) ; if ( substr ( $ name , 0 , 3 ) == 'og:' || substr ( $ name , 0 , 3 ) == 'fb:' ) { if ( $ name == 'og:image' ) { return "<meta property=\"$name\" content=\"$content&auto=format%2Ccompress...
Returns a meta tag with the given name and content .
54,680
private function rotate ( ContextInterface $ context , array $ dependencies ) : array { if ( empty ( $ dependencies ) ) { return [ ] ; } $ top = array_shift ( $ dependencies ) ; $ variants = [ ] ; foreach ( $ top -> getVariants ( ) as $ value ) { $ variant = $ context -> withDependency ( new ValueDependency ( $ top -> ...
Rotate all possible context values using recursive tree walk .
54,681
protected function _getStackEntry ( $ file_path , $ priority = null , $ is_minified = null ) { $ stack_entry = $ this -> _default_stack_entry ; if ( is_array ( $ file_path ) ) { $ stack_entry = array_merge ( $ stack_entry , $ file_path ) ; if ( isset ( $ stack_entry [ 'is_minified' ] ) ) { $ stack_entry [ 'minified' ] ...
Get a full formated stack entry
54,682
public function addIfExists ( $ file_path ) { $ _fp = $ this -> __template -> findAsset ( $ file_path ) ; if ( $ _fp || \ AssetsManager \ Loader :: isUrl ( $ file_path ) ) { return $ this -> add ( $ file_path ) ; } return $ this ; }
Add a javascript file in javascript stack
54,683
public function set ( array $ files ) { if ( ! empty ( $ files ) ) { foreach ( $ files as $ _file ) { $ this -> add ( $ _file ) ; } } return $ this ; }
Set a full javascript stack
54,684
public function writeMerged ( $ mask = '%s' ) { $ str = '' ; foreach ( $ this -> cleanStack ( $ this -> getMerged ( ) , 'path' ) as $ entry ) { $ tag_attrs = array ( 'type' => 'text/javascript' , 'src' => $ entry [ 'path' ] ) ; $ str .= sprintf ( $ mask , Html :: writeHtmlTag ( 'script' , null , $ tag_attrs ) ) ; } ret...
Write merged versions of the files stack in the cache directory
54,685
public function addMinified ( $ file_path ) { $ stack = $ this -> _getStackEntry ( $ file_path , null , true ) ; $ this -> registry -> addEntry ( $ stack , 'javascript_files' ) ; $ this -> registry -> addEntry ( $ stack , 'javascript_minified_files' ) ; return $ this ; }
Add an minified file
54,686
public function setMinified ( array $ files ) { if ( ! empty ( $ files ) ) { foreach ( $ files as $ _file ) { $ this -> addMinified ( $ _file ) ; } } return $ this ; }
Set a stack of minified files
54,687
public static function simple ( ) { return new static ( new DetailFactory ( new PhotoFactory ( ) ) , new CategoryFactory ( ) , new ContactFactory ( ) , new LocationFactory ( ) , new TipGroupFactory ( new TipFactory ( ) ) , new PhotoGroupFactory ( new PhotoFactory ( ) ) ) ; }
Convenience factory method creating a standard Venue factory configuration .
54,688
private function getCategories ( Description $ description ) { return array_map ( function ( \ stdClass $ categoryDescription ) { return $ this -> categoryFactory -> create ( new Description ( $ categoryDescription ) ) ; } , $ description -> getOptionalProperty ( 'categories' , [ ] ) ) ; }
Get the venue categories .
54,689
private function getTipGroups ( Description $ description ) { $ tipsDescription = $ description -> getOptionalProperty ( 'tips' ) ; if ( ! ( $ tipsDescription instanceof Description ) ) { return [ ] ; } return array_map ( function ( \ stdClass $ groupDescription ) { return $ this -> tipGroupFactory -> create ( new Desc...
Get the venue tip groups .
54,690
private function getPhotoGroups ( Description $ description ) { $ photosDescription = $ description -> getOptionalProperty ( 'photos' ) ; if ( ! ( $ photosDescription instanceof Description ) ) { return [ ] ; } return array_map ( function ( \ stdClass $ groupDescription ) { return $ this -> photoGroupFactory -> create ...
Get the photo groups .
54,691
public function generateProperties ( ) { $ attributes = $ this -> getAttributes ( ) ; $ properties = 'Class Properties:' . "\n" ; foreach ( $ attributes as $ name => $ attribute ) { $ properties .= '@property ' ; switch ( $ attribute [ 'type' ] ) { case 'self::TYPE_INT' : $ properties .= 'integer' ; break ; case 'self:...
Generate class properties comment
54,692
public function generateAttributes ( ) { $ attributes = $ this -> getAttributes ( ) ; $ this -> addLine ( 'protected static $attributes = array (' ) ; $ this -> tabUp ( FALSE ) ; foreach ( $ attributes as $ name => $ attribute ) { $ this -> addLine ( $ this -> tabVals ( '\'' . $ name . '\'' , 'array (' , 4 , '=> ' ) ) ...
Generate class attribute array
54,693
public function getPk ( ) { if ( ! $ this -> get ( 'table' ) ) { return FALSE ; } $ db = new Db ; return $ db -> getPrimaryKey ( $ this -> get ( 'database' ) , $ this -> get ( 'table' ) ) ; }
Return class primary key
54,694
public function getAttributes ( ) { if ( $ this -> attributeCache === FALSE ) { $ this -> attributeCache = array ( ) ; if ( $ this -> get ( 'table' ) ) { $ db = new Db ; foreach ( $ db -> getColumns ( $ this -> get ( 'database' ) , $ this -> get ( 'table' ) ) as $ column ) { $ attribute = array ( 'get' => 'TRUE' , 'set...
Return class attributes
54,695
public function getRelations ( ) { $ db = new Db ; $ relations = $ db -> getRelations ( $ this -> get ( 'database' ) , $ this -> get ( 'table' ) ) ; $ namespace = $ this -> getRootNamespace ( ) ; foreach ( $ relations as $ constraint ) { if ( isset ( $ this -> attributeCache [ $ constraint [ 'attribute' ] ] ) ) { $ thi...
Add attribute class relationships
54,696
public function getRootNamespace ( ) { $ arr = explode ( '\\' , $ this -> get ( 'namespace' ) ) ; $ table = explode ( '_' , $ this -> get ( 'table' ) ) ; $ ns = [ ] ; foreach ( $ arr as $ nsSegment ) { $ tableSegment = array_shift ( $ table ) ; if ( strtolower ( $ nsSegment ) != strtolower ( $ tableSegment ) ) { $ ns [...
Return root namespace
54,697
public function lineComment ( $ strComment ) { $ this -> class .= Comment :: lineComment ( $ strComment , $ this -> tabCount ) ; if ( $ this -> autoSpaces ) { $ this -> addLine ( ) ; } }
Add a line comment to the class
54,698
public function starComment ( $ strComment ) { $ this -> class .= Comment :: starComment ( $ strComment , $ this -> tabCount ) ; if ( $ this -> autoSpaces ) { $ this -> addLine ( ) ; } }
Add a star comment to the class
54,699
public function phpdocComment ( $ strComment ) { $ this -> class .= Comment :: phpdocComment ( $ strComment , $ this -> tabCount ) ; if ( $ this -> autoSpaces ) { $ this -> addLine ( ) ; } }
Add a PHPDoc comment to the class