idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
5,900 | public function getValues ( ) { $ cookies = [ ] ; try { foreach ( $ this -> cookies as $ name => $ cookie ) { $ cookies [ $ name ] = $ cookie -> getValue ( ) ; } } catch ( CookieException $ ce ) { throw $ ce ; } return $ cookies ; } | Get values from all registered cookies and dump as an associative array |
5,901 | public function save ( ) { try { foreach ( $ this -> cookies as $ c ) { $ c -> save ( ) ; } } catch ( CookieException $ ce ) { throw $ ce ; } return true ; } | Save all registered cookies |
5,902 | public function load ( ) { try { foreach ( $ this -> cookies as $ c ) { $ c -> load ( ) ; } } catch ( CookieException $ ce ) { throw $ ce ; } return $ this ; } | Load all registered cookies |
5,903 | public function addCategory ( array $ category ) { if ( empty ( $ category [ 'term' ] ) ) { require_once 'Zend/Feed/Builder/Exception.php' ; throw new Zend_Feed_Builder_Exception ( "you have to define the name of the category" ) ; } if ( ! $ this -> offsetExists ( 'category' ) ) { $ categories = array ( $ category ) ; ... | Add a category to the entry |
5,904 | public function addEnclosure ( $ url , $ type = '' , $ length = '' ) { if ( ! $ this -> offsetExists ( 'enclosure' ) ) { $ enclosure = array ( ) ; } else { $ enclosure = $ this -> offsetGet ( 'enclosure' ) ; } $ enclosure [ ] = array ( 'url' => $ url , 'type' => $ type , 'length' => $ length ) ; $ this -> offsetSet ( '... | Add an enclosure to the entry |
5,905 | public function all ( ) { $ result = array ( ) ; $ data = $ this -> data ( ) ; if ( ! is_array ( $ data ) ) $ data = array ( $ data ) ; foreach ( $ data as $ entry ) { $ result [ ] = $ this -> resolveActionFromStdClass ( $ entry ) ; } return $ result ; } | returns a list of all actions |
5,906 | public function action ( ) { $ action = $ this -> data ( ) ; if ( ! $ action instanceof stdClass ) return null ; return $ this -> resolveActionFromStdClass ( $ action ) ; } | returns the action or null |
5,907 | protected function sessionSection ( Request $ request ) : SectionInterface { if ( empty ( $ request -> getAttribute ( SessionStarter :: ATTRIBUTE ) ) ) { throw new AuthException ( "Unable to use authorization thought session, no session exists" ) ; } $ session = $ request -> getAttribute ( SessionStarter :: ATTRIBUTE )... | Get session section from given request . |
5,908 | public function toJson ( array $ fields = [ ] , array $ expand = [ ] , $ recursive = true ) { return Json :: encode ( $ this -> toArray ( $ fields , $ expand , $ recursive ) ) ; } | Converts the model into an json . |
5,909 | public static function create ( $ name = null , $ driver = 'file' ) { if ( is_null ( $ name ) ) { return new static ( null , $ driver ) ; } if ( ! isset ( static :: $ instances [ $ name ] ) ) { static :: $ instances [ $ name ] = new static ( $ name , $ driver ) ; } return static :: $ instances [ $ name ] ; } | Create a configuration instance |
5,910 | public function driver ( $ driver ) { $ driver = CCCORE_NAMESPACE . '\\' . 'CCConfig_' . ucfirst ( $ driver ) ; if ( ! class_exists ( $ driver ) ) { throw new \ InvalidArgumentException ( "CCConfig - Invalid driver '" . $ driver . "'" ) ; } $ this -> _driver = new $ driver ; } | Set the configuration dirver |
5,911 | public function name ( $ name = null ) { if ( is_null ( $ name ) ) { return $ this -> _instance_name ; } $ this -> _instance_name = $ name ; } | Name getter and setter |
5,912 | public function write ( $ driver = null ) { if ( empty ( $ this -> _instance_name ) ) { throw new CCException ( "CCConfig::write - configuration name is missing." ) ; } if ( ! is_null ( $ driver ) ) { $ this -> driver ( $ driver ) ; } $ this -> _driver -> write ( $ this -> _instance_name , $ this -> _data ) ; } | save a configuration file this method overwrites your configuration file!! |
5,913 | public function _delete ( ) { if ( empty ( $ this -> _instance_name ) ) { throw new CCException ( "CCConfig::write - configuration name is missing." ) ; } return $ this -> _driver -> delete ( $ this -> _instance_name ) ; } | Delete the entire configuration Attention with this one he can be evil! |
5,914 | final protected function initTaxonomiesTrait ( ) : void { add_action ( "init" , function ( ) { foreach ( $ this -> getTaxonomies ( ) as $ taxonomy ) { $ this -> registerTaxonomy ( $ taxonomy ) ; } } , 15 ) ; } | Initializes this trait and registers these taxonomies using the appropriate WordPress action hook . |
5,915 | protected function beforeApplyOptions ( $ stub ) { $ refModel = new ReflectionClass ( $ this -> model ) ; $ refIntermeidateModel = new ReflectionClass ( $ this -> defaultOptions [ 'intermediate_model' ] ) ; $ model = $ refIntermeidateModel -> getShortName ( ) ; if ( $ refModel -> getNamespaceName ( ) !== $ refIntermeid... | replace more before apply options code |
5,916 | public static function instance ( ) { if ( null === self :: $ _instance ) { $ session_factory = new SessionFactory ; $ session = $ session_factory -> newInstance ( $ _COOKIE ) ; $ segment = $ session -> getSegment ( 'Barebone\Session' ) ; self :: $ _instance = $ segment ; } return self :: $ _instance ; } | Instantiate Session Segment |
5,917 | public static function setup ( $ prefix = null ) { $ theme = self :: name ( $ prefix ) ; $ path = self :: find ( $ theme ) ; if ( $ path !== null ) { $ config = self :: getData ( $ theme , 'meta' ) ; if ( $ config -> get ( 'type' ) == 'theme' ) { return $ theme ; } } return null ; } | Setup current theme . |
5,918 | public static function find ( $ theme ) { $ paths = App :: path ( 'Plugin' ) ; foreach ( $ paths as $ path ) { $ path = FS :: clean ( $ path . '/' , DS ) ; $ themeFolder = $ path . $ theme ; if ( FS :: isDir ( $ themeFolder ) ) { return $ themeFolder ; } } return Configure :: read ( 'plugins.' . $ theme ) ; } | Find theme plugin in path . |
5,919 | private function assertCurlResult ( $ curl , $ result , $ descriptor ) { if ( $ result === false ) { $ error = curl_error ( $ curl ) ; @ curl_close ( $ curl ) ; throw new RequestError ( $ error , $ descriptor ) ; } @ curl_close ( $ curl ) ; return $ result ; } | Asserts that the curl result was successful . |
5,920 | private function parseHeader ( $ header ) { list ( $ key , $ value ) = explode ( ": " , trim ( $ header ) , 2 ) ; return array ( strtolower ( $ key ) , $ value ) ; } | Parses an HTTP header line . |
5,921 | private function openFile ( $ file , $ mode ) { $ handle = @ fopen ( $ file , $ mode ) ; if ( $ handle === false ) { throw new \ InvalidArgumentException ( "Could not open $file" ) ; } return $ handle ; } | Opens a file and returns a file handle . |
5,922 | public function getRoute ( $ name ) { if ( ! isset ( $ this -> routes [ $ name ] ) ) { throw new \ LogicException ( sprintf ( 'Route "%s" not found.' , $ name ) ) ; } return $ this -> routes [ $ name ] ; } | Get Route from name |
5,923 | public function getSetting ( $ name ) { if ( ! isset ( $ this -> settings [ $ name ] ) ) { throw new \ LogicException ( sprintf ( 'The setting "%s" don\'t exists.' , $ name ) ) ; } return $ this -> settings [ $ name ] ; } | Set setting from name |
5,924 | public function getMetadata ( $ className , $ subset ) { $ classMetadataCacheKey = $ this -> getClassMetadataCacheKey ( $ className ) ; $ classMetadata = $ this -> cacheStorage -> getItem ( $ classMetadataCacheKey ) ; if ( $ classMetadata === null ) { $ classMetadata = $ this -> readClassMetadata ( $ className ) ; $ th... | Returns metadata for specified subset of class fields |
5,925 | protected static function readPropertyAnnotations ( \ ReflectionProperty & $ property , AnnotationReader & $ reader ) { $ dataMap = [ ] ; $ strategyMap = [ ] ; $ validatorsMap = [ ] ; foreach ( $ reader -> getPropertyAnnotations ( $ property ) as $ annotation ) { switch ( true ) { case ( $ annotation instanceof DT \ An... | Reads and groups up annotations for specified property |
5,926 | protected static function isValidGetter ( \ ReflectionClass & $ reflection , $ name ) { if ( ! $ reflection -> hasMethod ( $ name ) ) { throw new \ LogicException ( sprintf ( 'Invalid metadata for %s: no getter %s.' , $ reflection -> getName ( ) , $ name ) ) ; } $ getter = $ reflection -> getMethod ( $ name ) ; if ( ! ... | Validates if class has valid getter method with specified name |
5,927 | protected static function isValidSetter ( \ ReflectionClass & $ reflection , $ name ) { if ( ! $ reflection -> hasMethod ( $ name ) ) { throw new \ LogicException ( sprintf ( 'Invalid metadata for %s: no setter %s.' , $ reflection -> getName ( ) , $ name ) ) ; } $ setter = $ reflection -> getMethod ( $ name ) ; if ( ! ... | Validates if class has valid setter method with specified name |
5,928 | public function validate ( array $ array ) { $ messages = [ ] ; foreach ( $ this -> metadata -> fields as $ field ) { $ value = array_key_exists ( $ field , $ array ) ? $ array [ $ field ] : null ; if ( ! ( ( $ value === null ) && $ this -> metadata -> nullables [ $ field ] ) ) { $ validator = $ this -> getValidator ( ... | Validates associative array according metadata |
5,929 | protected function getValidator ( $ field ) { $ result = null ; if ( isset ( $ this -> validators [ $ field ] ) ) { $ result = $ this -> validators [ $ field ] ; } else { $ result = new ValidatorChain ( ) ; $ result -> setPluginManager ( $ this -> validatorPluginManager ) ; if ( isset ( $ this -> metadata -> validators... | Builds validator chain for specified field according metadata |
5,930 | public function getTemplatePath ( ) { $ useRepositoryLayer = config ( 'generator.use_repository_layer' , true ) ; $ useServiceLayer = config ( 'generator.use_service_layer' , true ) ; if ( $ useServiceLayer && $ useRepositoryLayer ) { $ templateFilename = 'Controller_Service' ; } elseif ( $ useRepositoryLayer ) { $ tem... | Get the template path for generate |
5,931 | public function getResponseCode ( ) { $ code = 0 ; $ dom = $ this -> getDOMDocument ( ) ; $ xpath = new DOMXPath ( $ dom ) ; if ( ( $ codeAttribute = $ xpath -> query ( '/response/@code' ) -> item ( 0 ) ) instanceof DOMAttr ) { $ code = intval ( $ codeAttribute -> nodeValue ) ; } return $ code ; } | Returns the response code from the API . |
5,932 | public function getErrorMessage ( ) { $ errorMessage = '' ; $ dom = $ this -> getDOMDocument ( ) ; $ xpath = new DOMXPath ( $ dom ) ; if ( ( $ errorNode = $ xpath -> query ( '/response/error' ) -> item ( 0 ) ) instanceof DOMNode ) { $ errorMessage = $ errorNode -> nodeValue ; } return $ errorMessage ; } | Returns the error message from the Tulip API . |
5,933 | public function getDOMDocument ( ) { if ( $ this -> domDocument instanceof DOMDocument === false ) { $ this -> domDocument = new DOMDocument ( '1.0' , 'UTF-8' ) ; libxml_clear_errors ( ) ; $ previousSetting = libxml_use_internal_errors ( true ) ; @ $ this -> domDocument -> loadXML ( $ this -> response -> getBody ( ) ) ... | Returns the response body as DOMDocument instance . |
5,934 | private function buildAuthorizationHeader ( $ oauth ) { $ return = 'Authorization: OAuth ' ; $ values = array ( ) ; foreach ( $ oauth as $ key => $ value ) { $ values [ ] = "$key=\"" . rawurlencode ( $ value ) . "\"" ; } $ return .= implode ( ', ' , $ values ) ; return $ return ; } | Private method to generate authorization header used by cURL |
5,935 | private function checkOptGroup ( $ options , $ class , $ style ) { foreach ( $ options as $ option ) { if ( ! isset ( $ option [ 'value' ] ) ) { $ result = $ this -> checkOptGroup ( $ option , $ class , $ style ) ; if ( $ result ) { return $ result ; } continue ; } if ( $ this -> isSelected ( $ option ) ) { return spri... | Scan an option group for the selected option . |
5,936 | public function getAuthManager ( ) : ? AuthManager { if ( ! $ this -> hasAuthManager ( ) ) { $ this -> setAuthManager ( $ this -> getDefaultAuthManager ( ) ) ; } return $ this -> authManager ; } | Get auth manager |
5,937 | public static function generate ( string $ yasql , string $ name = null , int $ indent = null ) { $ model = new Parser ( $ yasql , $ name ) ; $ view = new Generator ( $ model , $ indent ) ; return $ view -> output ( ) ; } | Generates the SQL from a YASQL |
5,938 | public static function parse ( string $ yasql , string $ name = null ) { $ parser = new Parser ( $ yasql , $ name ) ; return $ parser -> getData ( ) ; } | Parses a YASQL and returns the parsed data |
5,939 | public function getCacheFactory ( ) : ? Factory { if ( ! $ this -> hasCacheFactory ( ) ) { $ this -> setCacheFactory ( $ this -> getDefaultCacheFactory ( ) ) ; } return $ this -> cacheFactory ; } | Get cache factory |
5,940 | public function saveXml ( ) { $ doc = new DOMDocument ( $ this -> _element -> ownerDocument -> version , $ this -> _element -> ownerDocument -> actualEncoding ) ; $ doc -> appendChild ( $ doc -> importNode ( $ this -> _element , true ) ) ; $ doc -> formatOutput = true ; return $ doc -> saveXML ( ) ; } | Override Zend_Feed_Element to allow formated feeds |
5,941 | public function send ( ) { if ( headers_sent ( ) ) { require_once 'Zend/Feed/Exception.php' ; throw new Zend_Feed_Exception ( 'Cannot send ATOM because headers have already been sent.' ) ; } header ( 'Content-Type: application/atom+xml; charset=' . $ this -> _element -> ownerDocument -> actualEncoding ) ; echo $ this -... | Send feed to a http client with the correct header |
5,942 | public function getRedisFactory ( ) : ? Factory { if ( ! $ this -> hasRedisFactory ( ) ) { $ this -> setRedisFactory ( $ this -> getDefaultRedisFactory ( ) ) ; } return $ this -> redisFactory ; } | Get redis factory |
5,943 | public function boot ( ) { ValidatorFacade :: extend ( 'valid_nonce' , function ( $ attaribute , $ value , $ params , $ validator ) { $ action = $ params [ 0 ] ; return ( bool ) wp_verify_nonce ( $ value , $ action ) ; } ) ; } | Add valid_nonce validation rule |
5,944 | public function getEntity ( $ id , $ hydrationMode = AbstractQuery :: HYDRATE_OBJECT ) { return $ this -> getQueryBuilder ( [ 'id' => $ id ] ) -> getQuery ( ) -> setMaxResults ( 1 ) -> getOneOrNullResult ( $ hydrationMode ) ; } | Returns an entity by its ID . |
5,945 | public function getEntitiesById ( array $ ids , $ hydrationMode = AbstractQuery :: HYDRATE_OBJECT ) { return $ this -> getQueryBuilder ( [ 'id' => $ ids ] ) -> getQuery ( ) -> execute ( null , $ hydrationMode ) ; } | Returns a list of entities extracted by their IDs . |
5,946 | public function getEntities ( array $ options = [ ] , $ hydrationMode = AbstractQuery :: HYDRATE_OBJECT ) { $ options = EntityRepositoryOptionsResolver :: createAndResolve ( $ options ) ; return $ this -> getQueryBuilder ( $ options [ 'filters' ] , $ options [ 'sorting' ] ) -> getQuery ( ) -> execute ( null , $ hydrati... | Returns a list of all the entities . |
5,947 | public function getPaginatedEntities ( array $ options = [ ] , $ hydrationMode = AbstractQuery :: HYDRATE_OBJECT ) { $ options = PaginatedEntityRepositoryOptionsResolver :: createAndResolve ( $ options ) ; $ queryBuilder = $ this -> addPagination ( $ this -> getQueryBuilder ( $ options [ 'filters' ] , $ options [ 'sort... | Returns a paginated list of entities . |
5,948 | protected function getQueryBuilder ( array $ filters = [ ] , array $ sorting = [ ] ) { $ queryBuilder = $ this -> getBaseQueryBuilder ( ) ; if ( ! empty ( $ filters ) ) { $ this -> addFilters ( $ queryBuilder , $ filters ) ; } if ( empty ( $ sorting ) ) { $ this -> addSorting ( $ queryBuilder , $ this -> getDefaultSort... | Returns a complete QueryBuilder instance for the current entity . |
5,949 | protected function addFilters ( QueryBuilder $ queryBuilder , $ filters = array ( ) ) { foreach ( $ filters as $ field => $ value ) { $ methodName = sprintf ( 'add%sFilter' , ucfirst ( $ field ) ) ; if ( method_exists ( $ this , $ methodName ) ) { $ this -> $ methodName ( $ queryBuilder , $ value ) ; continue ; } if ( ... | Adds filters to the QueryBuilder instance . |
5,950 | protected function addSorting ( QueryBuilder $ queryBuilder , array $ sorting = [ ] ) { foreach ( $ sorting as $ field => $ sortOrder ) { if ( ! $ this -> isFieldSortable ( $ field ) ) { continue ; } if ( ! $ this -> isSortOrderValid ( $ sortOrder ) ) { continue ; } $ methodName = sprintf ( 'add%sSorting' , ucfirst ( $... | Adds sorting to the specified query builder . |
5,951 | protected function addPagination ( QueryBuilder $ queryBuilder , $ elementsPerPage , $ page = 1 ) { $ elementsPerPage = ( int ) $ elementsPerPage ; $ page = ( int ) $ page ; return $ queryBuilder -> setMaxResults ( $ elementsPerPage ) -> setFirstResult ( $ elementsPerPage * ( $ page - 1 ) ) ; } | Adds pagination to the specified query builder . |
5,952 | protected function hasJoin ( QueryBuilder $ queryBuilder , $ joinString ) { foreach ( $ queryBuilder -> getDQLPart ( 'join' ) as $ joinsList ) { foreach ( $ joinsList as $ joinExpression ) { if ( $ joinExpression -> getJoin ( ) == $ joinString ) { return true ; } } } return false ; } | Returns TRUE if the join string is already present inside the query builder FALSE otherwise . |
5,953 | public function renderStop ( $ stop ) { $ options = array ( ) ; $ options [ 'data-id' ] = ArrayHelper :: getValue ( $ stop , 'id' ) ; $ options [ 'data-text' ] = ArrayHelper :: getValue ( $ stop , 'text' ) ; $ options [ 'data-button' ] = ArrayHelper :: getValue ( $ stop , 'button' ) ; $ options [ 'data-class' ] = Array... | Renders a single stop |
5,954 | public function addText ( $ text , $ styleFont = null , $ styleParagraph = null ) { $ text = new PHPWord_Section_Text ( $ text , $ styleFont , $ styleParagraph ) ; $ this -> _elementCollection [ ] = $ text ; return $ text ; } | Add a Text Element |
5,955 | public function addObject ( $ src , $ style = null ) { $ object = new PHPWord_Section_Object ( $ src , $ style ) ; if ( ! is_null ( $ object -> getSource ( ) ) ) { $ inf = pathinfo ( $ src ) ; $ ext = $ inf [ 'extension' ] ; if ( strlen ( $ ext ) == 4 && strtolower ( substr ( $ ext , - 1 ) ) == 'x' ) { $ ext = substr (... | Add a OLE - Object Element |
5,956 | public function addPreserveText ( $ text , $ styleFont = null , $ styleParagraph = null ) { if ( $ this -> _insideOf == 'footer' || $ this -> _insideOf == 'header' ) { $ ptext = new PHPWord_Section_Footer_PreserveText ( $ text , $ styleFont , $ styleParagraph ) ; $ this -> _elementCollection [ ] = $ ptext ; return $ pt... | Add a PreserveText Element |
5,957 | public function createTextRun ( $ styleParagraph = null ) { $ textRun = new PHPWord_Section_TextRun ( $ styleParagraph ) ; $ this -> _elementCollection [ ] = $ textRun ; return $ textRun ; } | Create a new TextRun |
5,958 | public static function addTitle ( $ text , $ depth = 0 ) { $ anchor = '_Toc' . ++ self :: $ _anchor ; $ bookmarkId = self :: $ _bookmarkId ++ ; $ title = array ( ) ; $ title [ 'text' ] = $ text ; $ title [ 'depth' ] = $ depth ; $ title [ 'anchor' ] = $ anchor ; $ title [ 'bookmarkId' ] = $ bookmarkId ; self :: $ _title... | Add a Title |
5,959 | public static function reindex ( $ collection , $ getIndex = 'getIdentifier' ) { if ( ! Code :: isTraversable ( $ collection ) ) { throw new \ InvalidArgumentException ( '$collection muss Traversable sein. ' . Code :: varInfo ( $ collection ) ) ; } $ getIndex = Code :: castGetter ( $ getIndex ) ; $ ret = array ( ) ; fo... | Organisiert die Collection mit einem neuen Index |
5,960 | public static function getInstance ( $ name = self :: DEFAULT_NAME ) { if ( empty ( self :: $ _instances [ $ name ] ) ) { self :: $ _instances [ $ name ] = new Toolbar ( $ name ) ; } return self :: $ _instances [ $ name ] ; } | Get toolbar instance . |
5,961 | public function loadItemType ( $ type ) { $ signature = md5 ( $ type ) ; if ( isset ( $ this -> _buttons [ $ signature ] ) ) { return $ this -> _buttons [ $ signature ] ; } list ( $ plugin , $ name ) = pluginSplit ( $ type ) ; $ alias = Slug :: filter ( $ name , '_' ) ; $ aliasClass = Inflector :: classify ( $ alias ) ... | Load object of item type . |
5,962 | public function render ( ) { $ i = 0 ; $ output = [ ] ; $ count = count ( $ this -> _items ) ; foreach ( $ this -> _items as $ item ) { $ i ++ ; $ item [ 'class' ] = 'item-wrapper tb-item-' . $ i ; if ( $ i == 1 ) { $ item [ 'class' ] .= ' first' ; } if ( $ i == $ count ) { $ item [ 'class' ] .= ' last' ; } $ output [ ... | Render toolbar items . |
5,963 | public function renderItem ( & $ node ) { $ type = $ node [ 0 ] ; $ item = $ this -> loadItemType ( $ type ) ; if ( $ item === false ) { return null ; } return $ item -> render ( $ node ) ; } | Render toolbar item html . |
5,964 | protected function _getItemClassName ( $ plugin , $ aliasClass ) { if ( $ plugin === null ) { $ plugin = 'Core' ; } $ buttonClass = $ plugin . '.' . self :: CLASS_NAME_PREFIX . $ aliasClass ; $ className = App :: className ( $ buttonClass , self :: CLASS_TYPE ) ; if ( $ className === false ) { $ buttonClass = self :: C... | Get full class name . |
5,965 | protected function _createIcon ( HtmlHelper $ html , $ title , array $ options = [ ] ) { list ( $ options , $ iconOptions ) = $ this -> _createIconAttr ( $ options ) ; if ( Arr :: key ( 'createIcon' , $ iconOptions ) ) { unset ( $ iconOptions [ 'createIcon' ] ) ; $ title = $ html -> icon ( $ options [ 'icon' ] , $ icon... | Create current icon . |
5,966 | protected function _createIconAttr ( array $ options = [ ] ) { $ iconOptions = [ 'class' => '' ] ; if ( Arr :: key ( 'icon' , $ options ) ) { if ( Arr :: key ( 'iconClass' , $ options ) ) { $ iconOptions = $ this -> _addClass ( $ iconOptions , $ options [ 'iconClass' ] ) ; unset ( $ options [ 'iconClass' ] ) ; } list (... | Create icon attributes . |
5,967 | protected function _getBtnClass ( array $ options = [ ] ) { if ( Arr :: key ( 'button' , $ options ) ) { $ button = $ options [ 'button' ] ; unset ( $ options [ 'button' ] ) ; if ( is_callable ( $ this -> getConfig ( 'prepareBtnClass' ) ) ) { return ( array ) call_user_func ( $ this -> getConfig ( 'prepareBtnClass' ) ,... | Create and get button classes . |
5,968 | protected function _getToolTipAttr ( array $ options = [ ] , $ toggle = 'tooltip' ) { if ( Arr :: key ( 'tooltip' , $ options ) ) { $ tooltip = $ options [ 'tooltip' ] ; unset ( $ options [ 'tooltip' ] ) ; if ( is_callable ( $ this -> getConfig ( 'prepareTooltip' ) ) ) { return ( array ) call_user_func ( $ this -> getC... | Create and get tooltip attributes . |
5,969 | protected function _prepareBeforeAfterContainer ( $ type , $ value ) { $ output = null ; $ iconClass = ( $ type === 'before' ) ? 'prefix' : 'postfix' ; if ( $ value !== null ) { $ output = $ value ; if ( is_string ( $ output ) ) { $ hasIcon = preg_match ( '/icon:[a-zA-Z]/' , $ output ) ; if ( $ hasIcon > 0 ) { list ( ,... | Prepare before after content for input container . |
5,970 | protected function _setBtnClass ( $ button , array $ options = [ ] ) { if ( $ button !== true ) { $ classes = [ $ this -> _configRead ( 'btnPref' ) ] ; foreach ( ( array ) $ button as $ button ) { $ classes [ ] = $ this -> _configRead ( 'btnPref' ) . '-' . $ button ; } $ options = $ this -> _addClass ( $ options , impl... | Setup button classes by options . |
5,971 | protected function _setIconOptions ( array $ options = [ ] , array $ iconOptions = [ ] ) { $ icon = $ options [ 'icon' ] ; if ( Arr :: key ( 'iconInline' , $ options ) ) { $ iconPrefix = $ this -> _configRead ( 'iconPref' ) ; $ options = $ this -> _addClass ( $ options , implode ( ' ' , [ $ this -> _class ( 'icon' ) , ... | Setup icon options . |
5,972 | protected function _setTooltipTitle ( $ tooltip , array $ options = [ ] ) { if ( $ tooltip === true && ! Arr :: key ( 'title' , $ options ) ) { $ options [ 'title' ] = strip_tags ( $ options [ 'label' ] ) ; } if ( is_string ( $ tooltip ) ) { $ options [ 'title' ] = $ tooltip ; } return $ options ; } | Setup tooltip title by options . |
5,973 | public static function arrayAppendLast ( array $ array , string $ last , string $ others = null ) { $ count = count ( $ array ) ; foreach ( $ array as $ key => $ value ) { $ array [ $ key ] = $ value . ( -- $ count > 0 ? $ others : $ last ) ; } return $ array ; } | Appends a string to the last item in an array |
5,974 | public function getContentType ( ) { $ contentType = null ; $ _contentType = $ this -> getHeader ( 'Content-Type' ) ; if ( ! empty ( $ _contentType ) ) { $ _contentType = explode ( ';' , $ _contentType [ 0 ] ) ; $ contentType = $ _contentType [ 0 ] ; } return $ contentType ; } | Get primary content - type header without encoding info |
5,975 | public static function setResponseStatus ( int $ status ) : void { if ( array_key_exists ( $ status , Http :: $ http_status_messages ) ) { header ( 'HTTP/1.1 ' . $ status . ' ' . Http :: $ http_status_messages [ $ status ] ) ; } } | Set response header status |
5,976 | public static function getBaseUrl ( ) : string { $ https = ( isset ( $ _SERVER [ 'HTTPS' ] ) && strtolower ( $ _SERVER [ 'HTTPS' ] ) == 'on' ) ? 'https://' : 'http://' ; return $ https . rtrim ( rtrim ( $ _SERVER [ 'HTTP_HOST' ] , '\\/' ) . dirname ( $ _SERVER [ 'PHP_SELF' ] ) , '\\/' ) ; } | Gets the base URL |
5,977 | public static function getUriString ( ) : string { $ url = '' ; $ request_url = ( isset ( $ _SERVER [ 'REQUEST_URI' ] ) ) ? $ _SERVER [ 'REQUEST_URI' ] : '' ; $ script_url = ( isset ( $ _SERVER [ 'PHP_SELF' ] ) ) ? $ _SERVER [ 'PHP_SELF' ] : '' ; if ( $ request_url != $ script_url ) { $ url = trim ( preg_replace ( '/' ... | Get Uri String |
5,978 | public static function getUriSegment ( int $ segment ) { $ segments = self :: getUriSegments ( ) ; return isset ( $ segments [ $ segment ] ) ? $ segments [ $ segment ] : null ; } | Get Uri Segment |
5,979 | protected function matchCode ( $ code ) { $ language = $ code ; $ country = null ; $ parts = explode ( '-' , $ code ) ; if ( count ( $ parts ) === 2 ) { $ language = $ parts [ 0 ] ; $ country = strtoupper ( $ parts [ 1 ] ) ; } if ( in_array ( $ code , $ this -> languages ) ) { return [ $ language , $ country ] ; } else... | Tests whether the given code matches any of the configured languages . |
5,980 | public function aboutAction ( ) { $ oLicense = LicenseQuery :: create ( ) -> findOne ( ) ; require_once dirname ( __FILE__ ) . '/../../../../app/SymfonyRequirements.php' ; $ symfonyRequirements = new \ SymfonyRequirements ( ) ; $ symfonyRequirements -> addRequirement ( extension_loaded ( 'mcrypt' ) , "Check if mcrypt i... | Display form for license activation |
5,981 | public function initialize ( array $ config ) { $ isMaterializeCss = $ this -> getConfig ( 'materializeCss' , false ) ; if ( $ isMaterializeCss === true ) { $ this -> _configWrite ( 'prepareBtnClass' , function ( Helper $ form , $ options , $ button ) { return $ this -> _prepareBtn ( $ form , $ options , $ button ) ; }... | Constructor hook method . Implement this method to avoid having to overwrite the constructor and call parent . |
5,982 | public function getAssets ( $ key ) { $ value = Hash :: get ( $ this -> _assets , $ key ) ; if ( is_string ( $ value ) ) { return $ value ; } return Hash :: sort ( ( array ) $ value , '{n}.weight' , 'asc' ) ; } | Get sort assets included list . |
5,983 | public function icon ( $ icon = 'home' , array $ options = [ ] ) { $ iconPref = $ this -> _configRead ( 'iconPref' ) ; $ _classes = [ $ this -> _class ( __FUNCTION__ ) , $ iconPref , $ iconPref . '-' . $ icon , ] ; $ options = $ this -> _addClass ( $ options , implode ( ' ' , $ _classes ) ) ; $ classes = $ options [ 'c... | Create icon element . |
5,984 | public function less ( $ path , array $ options = [ ] ) { $ cssPath = [ ] ; if ( ! Arr :: key ( 'force' , $ options ) ) { $ options [ 'force' ] = false ; } if ( is_array ( $ path ) ) { foreach ( $ path as $ i ) { if ( $ result = $ this -> Less -> process ( $ i , $ options [ 'force' ] ) ) { $ cssPath [ ] = $ result ; } ... | Creates a CSS stylesheets from less . |
5,985 | public function link ( $ title , $ url = null , array $ options = [ ] ) { $ options = $ this -> addClass ( $ options , $ this -> _class ( __FUNCTION__ ) ) ; $ options = Hash :: merge ( [ 'escapeTitle' => false , 'clear' => false , 'label' => $ title , ] , $ options ) ; $ isClear = ( bool ) $ options [ 'clear' ] ; unset... | Create an html link . |
5,986 | public function status ( $ status = 0 , array $ url = [ ] , $ icon = 'circle' ) { $ class = ( int ) $ status === 1 ? 'ck-green' : 'ck-red' ; if ( count ( $ url ) === 0 ) { return $ this -> icon ( $ icon , [ 'class' => $ class ] ) ; } return $ this -> link ( null , 'javascript:void(0);' , [ 'icon' => $ icon , 'class' =>... | Create status icon or link . |
5,987 | public function toggle ( Entity $ entity , array $ url = [ ] , array $ data = [ ] ) { if ( count ( $ url ) === 0 ) { $ url = [ 'action' => 'toggle' , 'prefix' => $ this -> request -> getParam ( 'prefix' ) , 'plugin' => $ this -> request -> getParam ( 'plugin' ) , 'controller' => $ this -> request -> getParam ( 'control... | Create and render ajax toggle element . |
5,988 | protected function _setTitleAttr ( $ title , array $ options = [ ] ) { if ( ! Arr :: key ( 'title' , $ options ) ) { $ options [ 'title' ] = strip_tags ( $ title ) ; } return $ options ; } | Setup default title attr . |
5,989 | public function asFormattedXml ( $ compressed = false , $ indent = "\t" , $ level = 0 ) { JLog :: add ( 'JXMLElement::asFormattedXml() is deprecated, use SimpleXMLElement::asXml() instead.' , JLog :: WARNING , 'deprecated' ) ; $ out = '' ; $ out .= ( $ compressed ) ? '' : "\n" . str_repeat ( $ indent , $ level ) ; $ ou... | Return a well - formed XML string based on SimpleXML element |
5,990 | public function setLabel ( Label $ label ) { $ label -> checkId ( ) ; $ label -> setScriptEvents ( true ) ; $ this -> label = $ label ; return $ this ; } | Set the Label |
5,991 | public function setValues ( array $ values ) { $ this -> values = array ( ) ; foreach ( $ values as $ value ) { $ this -> addValue ( $ value ) ; } return $ this ; } | Set the possible values |
5,992 | public function getDefault ( ) { if ( $ this -> default ) { return $ this -> default ; } if ( ! empty ( $ this -> values ) ) { return reset ( $ this -> values ) ; } return null ; } | Get the default value |
5,993 | public function generateTree ( $ pad = '' , $ relativePath = '' ) { $ generatedMd = '' ; if ( ! empty ( $ this -> subPages ) ) { foreach ( $ this -> subPages as $ subPageName => $ subPage ) { $ subPageFile = './' . $ relativePath . $ subPageName . DIRECTORY_SEPARATOR . $ subPage -> getPageBfe ( ) ; $ generatedMd .= "$p... | Generate overview markdown tree |
5,994 | public function write ( ) { $ m = new \ Mustache_Engine ( [ 'loader' => new \ Mustache_Loader_FilesystemLoader ( __DIR__ . '/../views' ) ] ) ; $ template = $ m -> loadTemplate ( 'Page' ) ; $ generatedMd = $ template -> render ( $ this ) ; $ this -> writeSubPages ( ) ; @ mkdir ( $ this -> page_rd , 0777 , true ) ; file_... | Write markdown file |
5,995 | public function writeSubPages ( ) { foreach ( $ this -> subPages as $ subPageName => $ subPage ) { $ subPageDirectory = $ this -> page_rd . DIRECTORY_SEPARATOR . $ subPageName ; $ subPage -> setDirectory ( $ subPageDirectory ) ; $ subPage -> write ( ) ; } } | Write sub pages of this page |
5,996 | static public function getReadableType ( $ type ) { switch ( $ type ) { case self :: TYPE_GOOGLE : return 'google' ; case self :: TYPE_FACEBOOK : return 'facebook' ; case self :: TYPE_YAHOO : return 'yahoo' ; case self :: TYPE_TWITTER : return 'twitter' ; } } | Convert type to human - readable form |
5,997 | static public function getStorableType ( $ type ) { switch ( $ type ) { case 'google' : return self :: TYPE_GOOGLE ; case 'facebook' : return self :: TYPE_FACEBOOK ; case 'yahoo' : return self :: TYPE_YAHOO ; case 'twitter' : return self :: TYPE_TWITTER ; } } | Convert human - readable type to integer |
5,998 | public function getPsrLog ( ) : ? LoggerInterface { if ( ! $ this -> hasPsrLog ( ) ) { $ this -> setPsrLog ( $ this -> getDefaultPsrLog ( ) ) ; } return $ this -> psrLog ; } | Get psr log |
5,999 | public function doSearchKnowledgeBase ( $ data , $ form ) { if ( ! $ this -> kbPageId ) { return $ this -> controller -> redirectBack ( ) ; } $ page = KnowledgebasePage :: get ( ) -> byID ( $ this -> kbPageId ) ; if ( ! $ page ) { return $ this -> controller -> redirectBack ( ) ; } $ link = ( ! empty ( $ data [ 'Query'... | Handler for the form submission . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.