idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
8,100 | public static function clearInstancePool ( $ and_clear_all_references = false ) { if ( $ and_clear_all_references ) { foreach ( RemoteAppPeer :: $ instances as $ instance ) { $ instance -> clearAllReferences ( true ) ; } } RemoteAppPeer :: $ instances = array ( ) ; } | Clear the instance pool . |
8,101 | protected function getParamKeyByExpr ( ExprInterface $ expr ) { return str_replace ( '.' , '' , $ expr -> getField ( ) ) . ucfirst ( $ expr -> getExpression ( ) ) . uniqid ( ) ; } | Get the parameter key that is used by doctrine to put the query parameter identifier . |
8,102 | public function addImageUrl ( $ imageUrl ) { if ( ! in_array ( $ imageUrl , $ this -> imageUrls ) ) { array_push ( $ this -> imageUrls , $ imageUrl ) ; } return $ this ; } | Add an Image Url to preload |
8,103 | public function toHtml ( $ context = null ) : string { return wp_kses ( $ this -> unsafeRender ( $ context ) , $ this -> allowedHtml ) ; } | Convert the view to safe HTML . |
8,104 | protected function generateTranslations ( $ bundle , $ entity , $ metadata , $ forceOverwrite ) { try { $ this -> getTranslationsGenerator ( $ bundle ) -> generate ( $ bundle , $ entity , $ metadata [ 0 ] , $ forceOverwrite ) ; } catch ( \ RuntimeException $ e ) { } } | Tries to generate translations if they don t exist yet and if we need write operations on entities . |
8,105 | public function createMethod ( $ name , $ params = array ( ) , $ body = NULL , $ modifiers = 256 ) { $ method = $ this -> class -> createMethod ( $ name , $ params , $ body , $ modifiers ) ; $ method -> setClassBuilder ( $ this ) ; return $ method ; } | Erstellt eine neue Methode |
8,106 | public function getRequest ( array $ requestPostData ) { $ requestProperties = array ( 'username' => $ requestPostData [ 1 ] , 'password' => $ requestPostData [ 2 ] , 'title' => $ requestPostData [ 3 ] [ 'title' ] , 'description' => $ requestPostData [ 3 ] [ 'description' ] , 'keywords' => $ requestPostData [ 3 ] [ 'mt... | Creates an IFTTT Request from XML RPC post data |
8,107 | public static function getValue ( $ name ) { if ( array_key_exists ( $ name , $ _GET ) ) { return $ _GET [ $ name ] ; } if ( array_key_exists ( $ name , $ _POST ) ) { return $ _POST [ $ name ] ; } return null ; } | Get the submitted form value |
8,108 | public function toNanos ( $ d ) { $ v = $ this -> getValue ( ) ; return $ this -> x ( $ d , $ this -> { 'c' . $ v } / $ this -> c0 , PHP_INT_MAX / ( $ this -> { 'c' . $ v } / $ this -> c0 ) ) ; } | Convert to nanos |
8,109 | public function toMicros ( $ d ) { $ v = $ this -> getValue ( ) ; if ( $ v < self :: MICROSECONDS ) { return $ d / ( $ this -> c1 / $ this -> c0 ) ; } else { return $ this -> x ( $ d , $ this -> { 'c' . $ v } / $ this -> c1 , PHP_INT_MAX / ( $ this -> { 'c' . $ v } ) / $ this -> c1 ) ; } } | Convert to micros |
8,110 | public function toMillis ( $ d ) { $ v = $ this -> getValue ( ) ; if ( $ v < self :: MILLISECONDS ) { return $ d / ( $ this -> c2 / $ this -> { 'c' . $ v } ) ; } else { return $ this -> x ( $ d , $ this -> { 'c' . $ v } / $ this -> c2 , PHP_INT_MAX / ( $ this -> { 'c' . $ v } / $ this -> c2 ) ) ; } } | Convert to millies |
8,111 | public function toSeconds ( $ d ) { $ v = $ this -> getValue ( ) ; if ( $ v < self :: SECONDS ) { return $ d / ( $ this -> c3 / $ this -> { 'c' . $ v } ) ; } else { return $ this -> x ( $ d , $ this -> { 'c' . $ v } / $ this -> c3 , PHP_INT_MAX / ( $ this -> { 'c' . $ v } / $ this -> c3 ) ) ; } } | Convert to seconds |
8,112 | public function toMinutes ( $ d ) { $ v = $ this -> getValue ( ) ; if ( $ v < self :: MINUTES ) { return $ d / ( $ this -> c4 / $ this -> { 'c' . $ v } ) ; } else { return $ this -> x ( $ d , $ this -> { 'c' . $ v } / $ this -> c4 , PHP_INT_MAX / ( $ this -> { 'c' . $ v } / $ this -> c4 ) ) ; } } | Convert to minutes |
8,113 | public function toHours ( $ d ) { $ v = $ this -> getValue ( ) ; if ( $ v < self :: HOURS ) { return $ d / ( $ this -> c5 / $ this -> { 'c' . $ v } ) ; } else { return $ this -> x ( $ d , $ this -> { 'c' . $ v } / $ this -> c5 , PHP_INT_MAX / ( $ this -> { 'c' . $ v } / $ this -> c5 ) ) ; } } | Convert to hours |
8,114 | public function toDays ( $ d ) { $ v = $ this -> getValue ( ) ; return $ d / ( $ this -> c6 / $ this -> { 'c' . $ v } ) ; } | Convert to days |
8,115 | public function convert ( $ sourceDuration , TimeUnit $ sourceUnit ) { switch ( $ this -> getValue ( ) ) { case self :: NANOSECONDS : return $ sourceUnit -> toNanos ( $ sourceDuration ) ; case self :: MICROSECONDS : return $ sourceUnit -> toMicros ( $ sourceDuration ) ; case self :: MILLISECONDS : return $ sourceUnit -... | Convert the given time duration in the given unit to this unit . Conversions from finer to coarser granularities truncate so lose precision . For example converting 999 milliseconds to seconds results in 0 . Conversions from coarser to finer granularities with arguments that would numerically overflow saturate to - PHP... |
8,116 | private function x ( $ d , $ m , $ over ) { if ( $ d > $ over ) { return PHP_INT_MAX ; } if ( $ d < - $ over ) { return - PHP_INT_MAX - 1 ; } return $ d * $ m ; } | Scale d by m checking for overflow . This has a short name to make code more readable . |
8,117 | public function Link ( ) { $ link = '' ; switch ( $ this -> type ) { case 'Internal' : if ( $ this -> internal && ( $ page = SiteTree :: get ( ) -> byID ( $ this -> internal ) ) ) { $ link = $ page -> Link ( ) ; } break ; case 'External' : $ link = $ this -> external ; break ; case 'Email' : $ link = $ this -> email ? ... | Determines the link by the type and what is set |
8,118 | public function getDO ( ) { if ( ! empty ( $ this -> dataObject ) ) { list ( $ className , $ ID ) = explode ( '-' , $ this -> dataObject ) ; return DataList :: create ( $ className ) -> byID ( $ ID ) ; } return null ; } | Get the DataObject instance |
8,119 | public function addParentLocation ( $ parentLocation ) { $ locationObject = $ this -> convertToLocationObject ( $ parentLocation ) ; if ( ! isset ( $ locationObject -> data [ 'parent_location_id' ] ) || ( int ) $ locationObject -> data [ 'parent_location_id' ] < 1 ) { throw new InvalidDataStructureException ( 'Parent l... | Convert parameters to LocationCreateStruct and stores it on the ContentObject . |
8,120 | public function renderStandalone ( ) { $ domDocument = new \ DOMDocument ( "1.0" , "utf-8" ) ; $ domDocument -> xmlStandalone = true ; $ domElement = $ this -> render ( $ domDocument ) ; $ domDocument -> appendChild ( $ domElement ) ; return $ domDocument ; } | Render the Custom UI standalone |
8,121 | public function render ( \ DOMDocument $ domDocument ) { $ domElement = $ domDocument -> createElement ( "custom_ui" ) ; $ settings = $ this -> getSettings ( ) ; foreach ( $ settings as $ setting => $ value ) { if ( $ value === null ) { continue ; } $ settingDomElement = $ domDocument -> createElement ( $ setting ) ; $... | Render the Custom UI |
8,122 | protected function getSettings ( ) { return array ( "global" => $ this -> globalVisible , "challenge_info" => $ this -> challengeInfoVisible , "chat" => $ this -> chatVisible , "checkpoint_list" => $ this -> checkpointListVisible , "net_infos" => $ this -> netInfosVisible , "notice" => $ this -> noticeVisible , "round_... | Get associative array of all Custom UI settings |
8,123 | private function createLatteEngine ( ) { $ latte = new LatteEngine \ Engine ; $ latte -> setTempDirectory ( $ this -> temp ) ; $ latte -> onCompile [ ] = function ( $ latte ) { Bridges \ FormsLatte \ FormMacros :: install ( $ latte -> getCompiler ( ) ) ; } ; return $ latte ; } | Latte engine settings . |
8,124 | private function getBasePath ( ) { $ pathInfo = new Http \ RequestFactory ; $ basePath = rtrim ( $ pathInfo -> createHttpRequest ( ) -> url -> basePath , '/' ) ; return $ basePath ; } | Path to root . |
8,125 | public function render ( $ name , array $ params = [ ] ) { $ latte = $ this -> createLatteEngine ( ) ; $ basePath = [ 'basePath' => $ this -> getBasePath ( ) ] ; $ latte -> render ( $ name , $ params + $ basePath ) ; return $ latte ; } | Create a template and insert parameters . |
8,126 | public function bindCallback ( $ callback , $ argument = null ) { if ( $ callback instanceof Closure ) { call_user_func_array ( $ callback , [ $ this , $ argument ] ) ; } return $ this ; } | Bind a Closure callback to this query and execute it . |
8,127 | public function cache ( $ key , $ expires = null ) { if ( $ this -> getType ( ) !== self :: SELECT ) { return $ this ; } $ this -> _cacheKey = $ key ; $ this -> _cacheLength = $ expires ; return $ this ; } | Set the cache key and duration length . |
8,128 | public function count ( ) { $ repo = $ this -> getRepository ( ) ; return $ repo -> aggregate ( $ this -> limit ( 0 ) , __FUNCTION__ , $ repo -> getPrimaryKey ( ) ) ; } | Pass the query to the repository to interact with the database . Return the count of how many records exist . |
8,129 | public function data ( $ data ) { if ( $ data instanceof Arrayable ) { $ data = $ data -> toArray ( ) ; } else if ( ! is_array ( $ data ) ) { throw new InvalidArgumentException ( 'Data passed must be an array or extend the Titon\Type\Contract\Arrayable interface' ) ; } $ type = $ this -> getType ( ) ; if ( in_array ( $... | Set the data to use in an update insert or create index statement . We should also extract data to later bind during a prepared statement . |
8,130 | public function except ( Query $ query , $ flag = null ) { if ( $ flag === Dialect :: ALL ) { $ query -> attribute ( 'flag' , $ flag ) ; } return $ this -> _addCompound ( Dialect :: EXCEPT , $ query ) ; } | Add a select query as an except . |
8,131 | public function getAlias ( ) { if ( $ this -> getJoins ( ) || $ this instanceof SubQuery || in_array ( $ this -> getType ( ) , [ self :: CREATE_INDEX , self :: DROP_INDEX ] ) ) { return $ this -> _alias ; } return null ; } | Only return the alias if joins have been set or this is a sub - query . |
8,132 | public function getFields ( ) { $ fields = $ this -> _fields ; if ( $ this -> getJoins ( ) && ! $ fields && $ this -> getType ( ) === self :: SELECT ) { return array_keys ( $ this -> getRepository ( ) -> getSchema ( ) -> getColumns ( ) ) ; } return $ fields ; } | Return the list of fields and or values . Return all table fields if a join exists and no fields were whitelisted . |
8,133 | public function groupBy ( ) { $ fields = func_get_args ( ) ; if ( is_array ( $ fields [ 0 ] ) ) { $ fields = $ fields [ 0 ] ; } $ this -> _groupBy = array_unique ( array_merge ( $ this -> _groupBy , $ fields ) ) ; return $ this ; } | Set what fields to group on . |
8,134 | public function having ( $ field , $ op = null , $ value = null ) { return $ this -> _modifyPredicate ( $ this -> _having , Predicate :: ALSO , $ field , $ op , $ value ) ; } | Will modify or create a having predicate using the AND conjunction . |
8,135 | public function innerJoin ( $ table , array $ fields = [ ] , array $ on = [ ] ) { return $ this -> _addJoin ( Join :: INNER , $ table , $ fields , $ on ) ; } | Add a new INNER join . |
8,136 | public function intersect ( Query $ query , $ flag = null ) { if ( $ flag === Dialect :: ALL ) { $ query -> attribute ( 'flag' , $ flag ) ; } return $ this -> _addCompound ( Dialect :: INTERSECT , $ query ) ; } | Add a select query as an intersect . |
8,137 | public function last ( array $ options = [ ] ) { if ( $ order = $ this -> getOrderBy ( ) ) { $ this -> _orderBy = [ ] ; foreach ( $ order as $ field => $ dir ) { if ( $ dir === 'asc' ) { $ dir = 'desc' ; } else if ( $ dir === 'desc' ) { $ dir = 'asc' ; } if ( is_numeric ( $ field ) ) { $ this -> orderBy ( $ dir ) ; } e... | Return the last record from the results . Reverse the direction of any order by declarations . |
8,138 | public function leftJoin ( $ table , array $ fields = [ ] , array $ on = [ ] ) { return $ this -> _addJoin ( Join :: LEFT , $ table , $ fields , $ on ) ; } | Add a new LEFT join . |
8,139 | public function lists ( $ value = null , $ key = null , array $ options = [ ] ) { $ repo = $ this -> getRepository ( ) ; $ key = $ key ? : $ repo -> getPrimaryKey ( ) ; $ value = $ value ? : $ repo -> getDisplayField ( ) ; $ options [ 'key' ] = $ key ; $ options [ 'value' ] = $ value ; return $ this -> fields ( [ $ key... | Return all records as a key value list . |
8,140 | public function orderBy ( $ field , $ direction = self :: DESC ) { if ( is_array ( $ field ) ) { foreach ( $ field as $ key => $ dir ) { $ this -> orderBy ( $ key , $ dir ) ; } } else if ( $ field === 'RAND' ) { $ this -> _orderBy [ ] = $ this -> func ( 'RAND' ) ; } else if ( $ field instanceof Func ) { $ this -> _orde... | Set the fields and direction to order by . |
8,141 | public function orHaving ( $ field , $ op = null , $ value = null ) { return $ this -> _modifyPredicate ( $ this -> _having , Predicate :: EITHER , $ field , $ op , $ value ) ; } | Will modify or create a having predicate using the OR conjunction . |
8,142 | public function orWhere ( $ field , $ op = null , $ value = null ) { return $ this -> _modifyPredicate ( $ this -> _where , Predicate :: EITHER , $ field , $ op , $ value ) ; } | Will modify or create a where predicate using the OR conjunction . |
8,143 | public function outerJoin ( $ table , array $ fields = [ ] , array $ on = [ ] ) { return $ this -> _addJoin ( Join :: OUTER , $ table , $ fields , $ on ) ; } | Add a new OUTER join . |
8,144 | public function rightJoin ( $ table , array $ fields = [ ] , array $ on = [ ] ) { return $ this -> _addJoin ( Join :: RIGHT , $ table , $ fields , $ on ) ; } | Add a new RIGHT join . |
8,145 | public function save ( $ data = null , array $ options = [ ] ) { if ( $ data ) { $ this -> data ( $ data ) ; } return $ this -> getRepository ( ) -> save ( $ this , $ options ) ; } | Pass the query to the repository to interact with the database . Return the count of how many records were affected . |
8,146 | public function setType ( $ type ) { if ( ! in_array ( $ type , [ self :: INSERT , self :: MULTI_INSERT , self :: SELECT , self :: UPDATE , self :: DELETE , self :: TRUNCATE , self :: CREATE_TABLE , self :: CREATE_INDEX , self :: DROP_TABLE , self :: DROP_INDEX ] , true ) ) { throw new UnsupportedTypeException ( sprint... | Set the type of query . |
8,147 | public function straightJoin ( $ table , array $ fields , array $ on = [ ] ) { return $ this -> _addJoin ( Join :: STRAIGHT , $ table , $ fields , $ on ) ; } | Add a new STRAIGHT join . |
8,148 | public function subQuery ( ) { $ query = new SubQuery ( Query :: SELECT , $ this -> getRepository ( ) ) ; $ query -> fields ( func_get_args ( ) ) ; return $ query ; } | Instantiate a new query object that will be used for sub - queries . |
8,149 | public function union ( Query $ query , $ flag = null ) { if ( $ flag === Dialect :: ALL || $ flag === Dialect :: DISTINCT ) { $ query -> attribute ( 'flag' , $ flag ) ; } return $ this -> _addCompound ( Dialect :: UNION , $ query ) ; } | Add a select query as a union . |
8,150 | public function where ( $ field , $ op = null , $ value = null ) { return $ this -> _modifyPredicate ( $ this -> _where , Predicate :: ALSO , $ field , $ op , $ value ) ; } | Will modify or create a where predicate using the AND conjunction . |
8,151 | public function xorHaving ( $ field , $ op = null , $ value = null ) { return $ this -> _modifyPredicate ( $ this -> _having , Predicate :: MAYBE , $ field , $ op , $ value ) ; } | Will modify or create a having predicate using the XOR conjunction . |
8,152 | public function xorWhere ( $ field , $ op = null , $ value = null ) { return $ this -> _modifyPredicate ( $ this -> _where , Predicate :: MAYBE , $ field , $ op , $ value ) ; } | Will modify or create a where predicate using the XOR conjunction . |
8,153 | protected function _addCompound ( $ type , Query $ query ) { if ( $ query -> getType ( ) !== self :: SELECT ) { throw new InvalidQueryException ( sprintf ( 'Only a select query can be used with %s' , $ type ) ) ; } $ query -> attribute ( 'compound' , $ type ) ; $ this -> _compounds [ ] = $ query ; return $ this ; } | Add a new compound query . Only select queries can be used with compounds . |
8,154 | protected function _addJoin ( $ type , $ table , $ fields , $ on = [ ] ) { $ repo = $ this -> getRepository ( ) ; $ join = new Join ( $ type ) ; $ conditions = [ ] ; if ( is_array ( $ table ) ) { $ alias = $ table [ 1 ] ; $ table = $ table [ 0 ] ; } else { $ alias = $ table ; } foreach ( $ on as $ pfk => $ rfk ) { if (... | Add a new join type . |
8,155 | protected function _modifyPredicate ( & $ predicate , $ type , $ field , $ op , $ value ) { if ( ! $ predicate ) { $ predicate = new Predicate ( $ type ) ; } else if ( $ predicate -> getType ( ) !== $ type ) { throw new ExistingPredicateException ( sprintf ( 'Predicate clause already created using "%s" conjunction' , $... | Modify a predicate by adding additional clauses . |
8,156 | public function register ( ) { add_action ( 'admin_head' , array ( $ this , 'add_filters' ) ) ; add_action ( 'wp_head' , array ( $ this , 'add_filters' ) ) ; if ( is_array ( $ this -> config [ 'callback' ] ) ) { foreach ( $ this -> config [ 'callback' ] as $ handle => $ callback ) { $ callback -> register ( $ this -> c... | Register the plugin to the TinyMCE plugin registry and add a form callback or callbacks . |
8,157 | public function add_filters ( ) { if ( get_user_option ( 'rich_editing' ) ) { add_filter ( 'mce_external_plugins' , array ( $ this , 'register_plugin' ) ) ; add_filter ( 'mce_buttons' . ( $ this -> config [ 'row' ] > 1 ? '_' . $ this -> config [ 'row' ] : '' ) , array ( $ this , 'register_button' ) ) ; } } | Add a button to the tinyMCE editor if the user has the required settings . |
8,158 | public function setEnabledDesign ( $ style , $ subStyle = null ) { if ( $ style instanceof CheckBoxDesign ) { $ this -> feature -> setEnabledDesign ( $ style ) ; } else { $ checkBoxDesign = new CheckBoxDesign ( $ style , $ subStyle ) ; $ this -> feature -> setEnabledDesign ( $ checkBoxDesign ) ; } return $ this ; } | Set the enabled design |
8,159 | public function setDisabledDesign ( $ style , $ subStyle = null ) { if ( $ style instanceof CheckBoxDesign ) { $ this -> feature -> setDisabledDesign ( $ style ) ; } else { $ checkBoxDesign = new CheckBoxDesign ( $ style , $ subStyle ) ; $ this -> feature -> setDisabledDesign ( $ checkBoxDesign ) ; } return $ this ; } | Set the disabled design |
8,160 | public static function read ( $ key = '' , $ default = null ) { if ( empty ( $ key ) ) { return self :: instance ( ) -> all ( ) ; } if ( ! self :: exists ( $ key ) ) { return $ default ; } return self :: instance ( ) -> get ( $ key ) ; } | Read configuration value |
8,161 | public function send ( $ title , $ content , $ flag ) { $ headers = [ ] ; $ query = [ 'title' => $ title , 'content' => $ content , 'flag' => $ flag , ] ; if ( is_null ( $ this -> webhook ) ) { throw new Exception ( "Missing webhook" , 1 ) ; } $ response = $ this -> curl :: post ( $ this -> webhook , $ headers , $ quer... | Send the data to Mission Control |
8,162 | public function filter ( $ value , array $ options = [ ] ) { if ( ! is_string ( $ value ) || empty ( trim ( $ value ) ) ) return $ value ; $ this -> checkOptions ( $ options ) ; list ( $ currentFormat , $ targetFormat ) = array_map ( 'trim' , $ options ) ; return DateTime :: createFromFormat ( $ currentFormat , $ value... | Format date of the given string . |
8,163 | public function add_filter_by_key ( FilterInterface $ filter , $ key ) { if ( ! is_scalar ( $ key ) ) { throw new Exception \ InvalidArgumentException ( 'key should be a scalar value.' ) ; } $ key = ( string ) $ key ; if ( ! isset ( $ this -> filters_by_key [ $ key ] ) ) { $ this -> filters_by_key [ $ key ] = [ ] ; } $... | Adding a filter grouped by array key . |
8,164 | protected function filter_by_key ( $ values ) { if ( count ( $ this -> filters_by_key ) < 1 ) { return $ values ; } foreach ( $ values as $ key => $ value ) { if ( ! is_scalar ( $ value ) || ! isset ( $ this -> filters_by_key [ $ key ] ) ) { continue ; } $ filters = $ this -> filters_by_key [ $ key ] ; foreach ( $ filt... | Filters all values by array - key . |
8,165 | public static function create ( $ maniaLinkId = null , $ version = null , $ name = null , array $ children = null ) { return new static ( $ maniaLinkId , $ version , $ name , $ children ) ; } | Create a new ManiaLink |
8,166 | public function setId ( $ maniaLinkId ) { $ this -> maniaLinkId = ( string ) $ maniaLinkId ; if ( $ this -> maniaLinkId && ! $ this -> name ) { $ this -> setName ( $ this -> maniaLinkId ) ; } return $ this ; } | Set the ID |
8,167 | public function getDico ( $ createIfEmpty = true ) { if ( ! $ this -> dico && $ createIfEmpty ) { $ this -> setDico ( new Dico ( ) ) ; } return $ this -> dico ; } | Get the Dictionary |
8,168 | public function getStylesheet ( $ createIfEmpty = true ) { if ( ! $ this -> stylesheet && $ createIfEmpty ) { return $ this -> createStylesheet ( ) ; } return $ this -> stylesheet ; } | Get the Stylesheet |
8,169 | public function createStylesheet ( ) { if ( $ this -> stylesheet ) { return $ this -> stylesheet ; } $ stylesheet = new Stylesheet ( ) ; $ this -> setStylesheet ( $ stylesheet ) ; return $ this -> stylesheet ; } | Create and assign a new Stylesheet if necessary |
8,170 | public function getScript ( $ createIfEmpty = true ) { if ( ! $ this -> script && $ createIfEmpty ) { return $ this -> createScript ( ) ; } return $ this -> script ; } | Get the Script |
8,171 | public function createScript ( ) { if ( $ this -> script ) { return $ this -> script ; } $ script = new Script ( ) ; $ this -> setScript ( $ script ) ; return $ this -> script ; } | Create and assign a new Script if necessary |
8,172 | public function render ( $ echo = false , $ domDocument = null ) { $ isChild = ( bool ) $ domDocument ; if ( ! $ isChild ) { $ domDocument = new \ DOMDocument ( "1.0" , "utf-8" ) ; $ domDocument -> xmlStandalone = true ; } $ maniaLink = $ domDocument -> createElement ( "manialink" ) ; if ( ! $ isChild ) { $ domDocument... | Render the ManiaLink |
8,173 | public function encrypt ( $ text , $ email ) { $ key = $ this -> hasher -> key ( $ email ) ; return $ this -> crypter -> encrypt ( $ text , $ key ) ; } | encrypts a given string with given hash |
8,174 | protected function _buildEntryCache ( ) { $ this -> _entries = array ( ) ; foreach ( $ this -> _element -> childNodes as $ child ) { if ( $ child -> localName == $ this -> _entryElementName ) { $ this -> _entries [ ] = $ child ; } } } | Cache the individual feed elements so they don t need to be searched for on every operation . |
8,175 | public function get_manager ( $ params ) { if ( array_key_exists ( 'm' , $ params ) ) { $ manager = $ params [ 'm' ] ; } else { $ manager = reset ( $ params ) ; } if ( $ manager ) { $ this -> info ( 'Using session manager: ' . $ manager ) ; } else { $ manager = null ; $ this -> info ( 'Using default session manager.' )... | Get a manager instance |
8,176 | public function action_gc ( $ params ) { $ manager = $ this -> get_manager ( $ params ) ; $ manager -> gc ( ) ; $ this -> success ( 'Garbage collection executed successfully' ) ; } | Gabrage collect old sessions |
8,177 | protected function _mapAliases ( ) { return $ this -> cache ( __METHOD__ , function ( ) { $ query = $ this -> getQuery ( ) ; if ( ! $ query ) { return [ ] ; } $ alias = $ query -> getAlias ( ) ; $ map = [ $ query -> getTable ( ) => $ alias , strtolower ( $ alias ) => $ alias ] ; foreach ( $ query -> getJoins ( ) as $ j... | Return a mapping of table to alias for the primary table and joins . |
8,178 | public function create ( Video $ video , $ waitForIngest = 0 ) { if ( is_null ( $ video ) ) { throw new VideoClientException ( "No video provided" ) ; } if ( is_null ( $ video -> sourceUrl ) || ! filter_var ( $ video -> sourceUrl , FILTER_VALIDATE_URL ) ) { throw new VideoClientException ( "Invalid source URL" ) ; } $ ... | Creates a new video allowing a specific timeout while waiting for the video to downloaded and encoded . If not timeout is set then the function will return immediately before the ingest is complete . The video cannot be watermarked until it has been ingested at which point the video status will be INGESTED . |
8,179 | public function find ( $ videoKey ) { if ( is_null ( $ videoKey ) || empty ( $ videoKey ) ) { throw new VideoClientException ( "A key is needed to fnd a video" ) ; } try { $ videos = $ this -> get ( sprintf ( "%s?key=%s" , $ this -> apiResourcePath , $ videoKey ) ) ; return $ videos [ 0 ] ; } catch ( SafeStreamHttpExce... | Gets an existing video by it s key . |
8,180 | public function shiftFirstEntry ( ContentStream $ cs , $ type , \ Closure $ withFilter = NULL ) { if ( ( $ entry = $ cs -> findFirst ( $ type , $ withFilter ) ) != NULL ) { $ vars = $ this -> convertEntryTemplateVariables ( $ entry , $ cs ) ; $ cs -> removeEntry ( $ entry ) ; return $ vars ; } return NULL ; } | Finds the first occurence of the entry removes it and returns the template Variables for it |
8,181 | public function convertUnserialized ( Array $ serialized , ContentStream $ contentStream = NULL ) { if ( isset ( $ contentStream ) ) { foreach ( $ serialized as $ serializedEntry ) { $ entry = $ this -> unserializeEntry ( ( object ) $ serializedEntry ) ; $ entry -> setContentStream ( $ contentStream ) ; } return $ cont... | Convertes an serialized ContentStream to the real object structure |
8,182 | public function getContentManager ( ) { if ( $ this -> contentManager != null ) { return $ this -> contentManager ; } $ this -> contentManager = new ContentManager ( $ this -> options , $ this -> getContentService ( ) , $ this -> getContentTypeService ( ) , $ this -> getLocationService ( ) , $ this -> getLocationManage... | Returns content manager . |
8,183 | public function getLocationManager ( ) { if ( $ this -> locationManager != null ) { return $ this -> locationManager ; } $ this -> locationManager = new LocationManager ( $ this -> getLocationService ( ) , $ this -> getContentService ( ) ) ; if ( $ this -> logger ) { $ this -> locationManager -> setLogger ( $ this -> l... | Returns location manager . |
8,184 | public function getContentTypeManager ( ) { if ( $ this -> contentTypeManager != null ) { return $ this -> contentTypeManager ; } $ this -> contentTypeManager = new ContentTypeManager ( $ this -> getContentTypeService ( ) , $ this -> getLanguageManager ( ) , $ this -> getFieldDefinitionSubManager ( ) , $ this -> getCon... | Returns contenttype manager . |
8,185 | public function getLanguageManager ( ) { if ( $ this -> languageManager != null ) { return $ this -> languageManager ; } $ this -> languageManager = new LanguageManager ( $ this -> getLanguageService ( ) ) ; if ( $ this -> logger ) { $ this -> languageManager -> setLogger ( $ this -> logger ) ; } return $ this -> langu... | Returns language manager . |
8,186 | public function getUserGroupManager ( ) { if ( $ this -> userGroupManager != null ) { return $ this -> userGroupManager ; } $ this -> userGroupManager = new UserGroupManager ( $ this -> options , $ this -> getUserService ( ) , $ this -> getContentService ( ) , $ this -> getContentTypeService ( ) ) ; if ( $ this -> logg... | Returns user group manager . |
8,187 | public function getUserManager ( ) { if ( $ this -> userManager != null ) { return $ this -> userManager ; } $ this -> userManager = new UserManager ( $ this -> options , $ this -> getUserService ( ) , $ this -> getContentTypeService ( ) , $ this -> getUserGroupManager ( ) ) ; if ( $ this -> logger ) { $ this -> userMa... | Returns user manager . |
8,188 | protected function prepareHeaders ( $ method , $ url , array $ params , array $ overrides = [ ] ) { $ oauth = array_merge ( [ 'oauth_consumer_key' => $ this -> consumerKey , 'oauth_nonce' => md5 ( uniqid ( rand ( ) , true ) ) , 'oauth_signature_method' => 'HMAC-SHA1' , 'oauth_timestamp' => time ( ) , 'oauth_version' =>... | Prepares oauth headers for a given request . |
8,189 | public function getPasswordBrokerFactory ( ) : ? PasswordBrokerFactory { if ( ! $ this -> hasPasswordBrokerFactory ( ) ) { $ this -> setPasswordBrokerFactory ( $ this -> getDefaultPasswordBrokerFactory ( ) ) ; } return $ this -> passwordBrokerFactory ; } | Get password broker factory |
8,190 | public function getDefaultBroadcast ( ) : ? Broadcaster { $ manager = Broadcast :: getFacadeRoot ( ) ; if ( isset ( $ manager ) ) { return $ manager -> connection ( ) ; } return $ manager ; } | Get a default broadcast value if any is available |
8,191 | public function getExports ( $ whereUserIsGranted = true ) { foreach ( $ this -> exports as $ alias => $ export ) { if ( $ whereUserIsGranted ) { if ( $ this -> isGrantedForElement ( $ export , null , null ) ) { yield $ alias => $ export ; } } else { yield $ alias => $ export ; } } } | Return all exports . The exports s alias are the array s keys . |
8,192 | public function getExport ( $ alias ) { if ( ! array_key_exists ( $ alias , $ this -> exports ) ) { throw new \ RuntimeException ( "The export with alias $alias is not known." ) ; } return $ this -> exports [ $ alias ] ; } | Return an export by his alias |
8,193 | public function isGrantedForElement ( ExportElementInterface $ element , ExportInterface $ export = NULL , array $ centers = null ) { if ( $ element instanceof ExportInterface ) { $ role = $ element -> requiredRole ( ) ; } elseif ( $ element instanceof ModifierInterface ) { if ( is_null ( $ element -> addRole ( ) ) ) {... | Return true if the current user has access to the ExportElement for every center false if the user hasn t access to element for at least one center . |
8,194 | public function & getAggregatorsApplyingOn ( ExportInterface $ export , array $ centers = null ) { foreach ( $ this -> aggregators as $ alias => $ aggregator ) { if ( in_array ( $ aggregator -> applyOn ( ) , $ export -> supportsModifiers ( ) ) && $ this -> isGrantedForElement ( $ aggregator , $ export , $ centers ) ) {... | Return a \ Generator containing aggregators which support type |
8,195 | public function generate ( $ exportAlias , array $ pickedCentersData , array $ data , array $ formatterData ) { $ export = $ this -> getExport ( $ exportAlias ) ; $ centers = $ this -> getPickedCenters ( $ pickedCentersData ) ; $ query = $ export -> initiateQuery ( $ this -> retrieveUsedModifiers ( $ data ) , $ this ->... | Generate a response which contains the requested data . |
8,196 | private function buildCenterReachableScopes ( array $ centers , ExportElementInterface $ element ) { $ r = array ( ) ; foreach ( $ centers as $ center ) { $ r [ ] = array ( 'center' => $ center , 'circles' => $ this -> authorizationHelper -> getReachableScopes ( $ this -> user , $ element -> requiredRole ( ) , $ center... | build the array required for defining centers and circles in the initiate queries of ExportElementsInterfaces |
8,197 | public function getUsedAggregatorsAliases ( array $ data ) { $ aggregators = $ this -> retrieveUsedAggregators ( $ data [ ExportType :: AGGREGATOR_KEY ] ) ; return array_keys ( iterator_to_array ( $ aggregators ) ) ; } | get the aggregators typse used in the form export data |
8,198 | private function retrieveUsedModifiers ( $ data ) { $ usedTypes = array_merge ( $ this -> retrieveUsedFiltersType ( $ data [ ExportType :: FILTER_KEY ] ) , $ this -> retrieveUsedAggregatorsType ( $ data [ ExportType :: AGGREGATOR_KEY ] ) ) ; $ this -> logger -> debug ( 'Required types are ' . implode ( ', ' , $ usedTyp... | parse the data to retrieve the used filters and aggregators |
8,199 | private function retrieveUsedFiltersType ( $ data ) { $ usedTypes = array ( ) ; foreach ( $ data as $ alias => $ filterData ) { if ( $ filterData [ 'enabled' ] == true ) { $ filter = $ this -> getFilter ( $ alias ) ; if ( ! in_array ( $ filter -> applyOn ( ) , $ usedTypes ) ) { array_push ( $ usedTypes , $ filter -> ap... | Retrieve the filter used in this export . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.