idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
35,500 | public function load ( ) { $ this -> dictProvider -> setLangsPath ( $ this -> path ) ; $ dict = $ this -> dictProvider -> load ( $ this -> getUserLangs ( ) ) ; $ this -> loadedLang = $ this -> dictProvider -> getLoadedLang ( ) ; if ( $ dict === null ) { throw new CantLoadDictionaryException ( CantLoadDictionaryException :: NO_MATCHING_FILES ) ; } $ this -> setlocale ( ) ; return $ dict ; } | Load the dictionary that match the prefered languages . |
35,501 | private function setlocale ( ) { foreach ( $ this -> codeSets as $ code ) { if ( substr ( $ code , 0 , strlen ( $ this -> loadedLang ) ) === $ this -> loadedLang ) { setlocale ( LC_TIME , $ code ) ; break ; } } } | Say to PHP the locale to use for loaded lang |
35,502 | public function upload ( $ status , $ media , array $ parameters = array ( ) , $ appOnlyAuth = false ) { $ data = array ( 'status' => $ status , 'media[]' => $ media ) + $ parameters ; return $ this -> postStatusesUpdateWithMedia ( $ data , $ appOnlyAuth ) ; } | Updates the authenticating user s current status and attaches media for upload . In other words it creates a Tweet with a picture attached . |
35,503 | public function getStatusesRetweets ( $ id , array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> get ( "statuses/retweets/{$id}" , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Returns a collection of the 100 most recent retweets of the tweet specified by the id parameter . |
35,504 | public function getStatusesShow ( $ id , array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> get ( "statuses/show/{$id}" , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Returns a single Tweet specified by the id parameter . The Tweet s author will also be embedded within the tweet . |
35,505 | public function postStatusesDestroy ( $ id , array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> post ( "statuses/destroy/{$id}" , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Destroys the status specified by the required ID parameter . The authenticating user must be the author of the specified status . Returns the destroyed status if successful . |
35,506 | public function postStatusesRetweet ( $ id , array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> post ( "statuses/retweet/{$id}" , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Retweets a tweet . Returns the original tweet with retweet details embedded . |
35,507 | public function getStatusesOembed ( array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> get ( 'statuses/oembed' , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Returns information allowing the creation of an embedded representation of a Tweet on third party sites . |
35,508 | public function getStatusesRetweetersIds ( array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> get ( 'statuses/oembed' , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Returns a collection of up to 100 user IDs belonging to users who have retweeted the tweet specified by the id parameter . |
35,509 | public function updateApiEntity ( Order $ apiOrder , $ locale ) { $ items = $ apiOrder -> getItems ( ) ; $ groupedPrices = [ ] ; $ supplierItems = [ ] ; $ prices = $ this -> priceCalculator -> calculate ( $ items , $ apiOrder -> getNetShippingCosts ( ) , $ groupedPrices , $ supplierItems , $ this -> defaultCurrency ) ; if ( $ supplierItems ) { $ supplierItems = array_values ( $ supplierItems ) ; $ this -> createMediaForSupplierItems ( $ supplierItems , $ locale ) ; $ apiOrder -> setSupplierItems ( $ supplierItems ) ; } $ this -> createMediaForItems ( $ items , $ locale ) ; $ hasChangedPrices = false ; foreach ( $ items as $ item ) { if ( $ item -> getPriceChange ( ) ) { $ hasChangedPrices = true ; break ; } } $ apiOrder -> setHasChangedPrices ( $ hasChangedPrices ) ; $ apiOrder -> getEntity ( ) -> setTotalNetPrice ( $ prices [ 'totalNetPrice' ] ) ; $ apiOrder -> getEntity ( ) -> setTotalPrice ( $ prices [ 'totalPrice' ] ) ; $ apiOrder -> getEntity ( ) -> setTotalRecurringNetPrice ( $ prices [ 'totalRecurringNetPrice' ] ) ; $ apiOrder -> getEntity ( ) -> setTotalRecurringPrice ( $ prices [ 'totalRecurringPrice' ] ) ; $ apiOrder -> getEntity ( ) -> setShippingCosts ( $ prices [ 'shippingCosts' ] ) ; } | Function updates the api - entity like price - calculations . |
35,510 | public function getOrderTypeEntityById ( $ typeId ) { $ typeEntity = $ this -> orderTypeRepository -> find ( $ typeId ) ; if ( ! $ typeEntity ) { throw new EntityNotFoundException ( $ this -> orderTypeRepository -> getClassName ( ) , $ typeId ) ; } return $ typeEntity ; } | Returns OrderType entity with given id . |
35,511 | public function findOrderStatusById ( $ statusId ) { try { return $ this -> em -> getRepository ( self :: $ orderStatusEntityName ) -> find ( $ statusId ) ; } catch ( NoResultException $ nre ) { throw new EntityNotFoundException ( self :: $ orderStatusEntityName , $ statusId ) ; } } | Finds a status by id . |
35,512 | public function findOrderEntityById ( $ id ) { try { return $ this -> orderRepository -> find ( $ id ) ; } catch ( NoResultException $ nre ) { throw new EntityNotFoundException ( static :: $ orderEntityName , $ id ) ; } } | Find order entity by id . |
35,513 | public function findOrderEntityForItemWithId ( $ id , $ returnMultipleResults = false ) { try { return $ this -> orderRepository -> findOrderForItemWithId ( $ id , $ returnMultipleResults ) ; } catch ( NoResultException $ nre ) { throw new EntityNotFoundException ( static :: $ itemEntity , $ id ) ; } } | Find order for item with id . |
35,514 | public function findByIdAndLocale ( $ id , $ locale , $ updateApiEntity = true ) { $ order = $ this -> orderRepository -> findByIdAndLocale ( $ id , $ locale ) ; if ( ! $ order ) { return null ; } $ order = $ this -> orderFactory -> createApiEntity ( $ order , $ locale ) ; if ( $ updateApiEntity ) { $ this -> updateApiEntity ( $ order , $ locale ) ; } return $ order ; } | Finds an order by id and locale . |
35,515 | public function getOrderItemById ( $ itemId , OrderInterface $ order , & $ hasMultiple = false ) { $ item = $ this -> itemManager -> findEntityById ( $ itemId ) ; if ( ! $ item ) { throw new ItemNotFoundException ( $ itemId ) ; } $ match = false ; $ orders = $ this -> findOrderEntityForItemWithId ( $ itemId , true ) ; if ( $ orders ) { if ( count ( $ orders ) > 1 ) { $ hasMultiple = true ; } foreach ( $ orders as $ itemOrders ) { if ( $ order === $ itemOrders ) { $ match = true ; } } } if ( ! $ match ) { throw new OrderException ( 'User not owner of order' ) ; } return $ item ; } | Get order item by id and checks if item belongs to the order . |
35,516 | protected function getPropertyBasedOnPatch ( $ data , $ key , $ default , $ patch ) { if ( ! $ patch ) { $ default = null ; } return $ this -> getProperty ( $ data , $ key , $ default ) ; } | Gets Property of data array . If PUT set to null |
35,517 | private function checkIfSet ( $ key , array $ data ) { $ keyExists = array_key_exists ( $ key , $ data ) ; return $ keyExists && $ data [ $ key ] !== null && $ data [ $ key ] !== '' ; } | Checks if data is set . |
35,518 | protected function getQuery ( $ table , array $ fields , $ startIndex , $ count , $ sortBy , $ sortOrder , Condition $ condition = null ) { $ builder = $ this -> newQueryBuilder ( $ table ) -> select ( $ fields ) -> orderBy ( $ sortBy , $ sortOrder == Sql :: SORT_ASC ? 'ASC' : 'DESC' ) -> setFirstResult ( $ startIndex ) -> setMaxResults ( $ count ) ; return $ this -> convertBuilder ( $ builder , $ condition ) ; } | Returns an array which contains as first value a SQL query and as second an array of parameters . Uses by default the dbal query builder to create the SQL query . The query is used for the default query methods |
35,519 | protected function getQueryCount ( $ table , Condition $ condition = null ) { $ builder = $ this -> newQueryBuilder ( $ table ) -> select ( $ this -> connection -> getDatabasePlatform ( ) -> getCountExpression ( $ this -> getPrimaryKey ( ) ) ) ; return $ this -> convertBuilder ( $ builder , $ condition ) ; } | Returns an array which contains as first value a SQL query and as second an array of parameters . Uses by default the dbal query builder to create the SQL query . The query is used for the count method |
35,520 | public function populateFromDynamoDB ( array $ data ) { $ this -> tableName = $ data [ 'TableName' ] ; $ this -> tableStatus = $ data [ 'TableStatus' ] ; $ this -> creationDateTime = $ data [ 'CreationDateTime' ] ; $ this -> itemCount = ( isset ( $ data [ 'ItemCount' ] ) ? $ data [ 'ItemCount' ] : 0 ) ; $ this -> tableSizeBytes = ( isset ( $ data [ 'TableSizeBytes' ] ) ? $ data [ 'TableSizeBytes' ] : 0 ) ; $ keySchema = $ data [ 'KeySchema' ] ; $ hash = new KeySchemaElement ( $ keySchema [ 'HashKeyElement' ] [ 'AttributeName' ] , $ keySchema [ 'HashKeyElement' ] [ 'AttributeType' ] ) ; if ( isset ( $ keySchema [ 'RangeKeyElement' ] ) ) { $ range = new KeySchemaElement ( $ keySchema [ 'RangeKeyElement' ] [ 'AttributeName' ] , $ keySchema [ 'RangeKeyElement' ] [ 'AttributeType' ] ) ; } else { $ range = null ; } $ this -> keySchema = new KeySchema ( $ hash , $ range ) ; $ provisionedThroughput = $ data [ 'ProvisionedThroughput' ] ; $ this -> provisionedThroughput = new ProvisionedThroughput ( $ provisionedThroughput [ 'ReadCapacityUnits' ] , $ provisionedThroughput [ 'WriteCapacityUnits' ] , ( isset ( $ provisionedThroughput [ 'LastIncreaseDateTime' ] ) ? $ provisionedThroughput [ 'LastIncreaseDateTime' ] : null ) , ( isset ( $ provisionedThroughput [ 'LastDecreaseDateTime' ] ) ? $ provisionedThroughput [ 'LastDecreaseDateTime' ] : null ) ) ; } | Populate table description from the raw DynamoDB response |
35,521 | public function transformPaginator ( LengthAwarePaginator $ paginator ) { if ( ! $ this -> hasTransformer ( ) ) { return $ paginator ; } $ items = $ this -> transform ( $ paginator -> items ( ) ) -> toArray ( ) ; return new LengthAwarePaginator ( $ items , $ paginator -> total ( ) , $ paginator -> perPage ( ) , $ paginator -> currentPage ( ) ) ; } | Execute transform method on paginator items with specified transformer . |
35,522 | private function getEncryptedValue ( DecryptRequest $ request ) { if ( ! $ request -> getEncryptedValue ( ) ) { $ plaintextValue = $ request -> getEncryptedQuestionAsker ( ) -> askQuestion ( ) ; } else { $ plaintextValue = $ request -> getEncryptedValue ( ) ; } return $ plaintextValue ; } | Get encrypted value . |
35,523 | public function isSource ( $ newStatus = true ) { $ oldStatus = $ this -> isSource ; if ( func_num_args ( ) ) { $ this -> isSource = $ newStatus ; } return $ oldStatus ; } | Is this this the relation source? |
35,524 | public function get ( $ key , $ default = null ) { if ( strpos ( $ key , '.' ) ) { return $ this -> getRecursive ( $ key , $ default ) ; } if ( array_key_exists ( $ key , $ this -> parameters ) ) { return $ this -> parameters [ $ key ] ; } else { return $ default ; } } | Gets a parameter by name . |
35,525 | public function getRecursive ( $ key , $ default = null ) { $ params = $ this -> parameters ; if ( ! strpos ( $ key , '.' ) ) { return $ this -> get ( $ key , $ default ) ; } $ array = explode ( '.' , $ key ) ; foreach ( $ array as $ entry ) { if ( array_key_exists ( $ entry , $ params ) ) { $ params = $ params [ $ entry ] ; } else { return $ default ; } } return isset ( $ params ) ? $ params : $ default ; } | Gets a parameter by name recursively |
35,526 | protected function overrideCompilerEngine ( ) { $ app = $ this -> app ; $ resolver = $ app -> make ( 'view.engine.resolver' ) ; $ resolver -> register ( 'blade' , function ( ) use ( $ app ) { return new HackedCompilerEngine ( $ app [ 'blade.compiler' ] , $ app [ 'files' ] ) ; } ) ; } | For filter template output . |
35,527 | protected function extendBlade ( ) { $ blade = $ this -> app [ 'view' ] -> getEngineResolver ( ) -> resolve ( 'blade' ) -> getCompiler ( ) ; $ blade -> extend ( function ( $ value ) use ( $ blade ) { return $ this -> compileBlade ( $ value , $ blade ) ; } ) ; } | Extend Blade Syntax |
35,528 | public function getGeoSimilarPlaces ( array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> get ( 'geo/similar_places' , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Locates places near the given coordinates which are similar in name . |
35,529 | public function getReserveGeoCode ( array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> get ( 'geo/reserve_geocode' , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Given a latitude and a longitude searches for up to 20 places that can be used as a place_id when updating a status . This request is an informative call and will deliver generalized results about geography . |
35,530 | public function postGeoPlace ( array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> post ( 'geo/place' , $ parameters , $ multipart , $ appOnlyAuth ) ; } | As of December 2nd 2013 this endpoint is deprecated and retired and no longer functions . Place creation was used infrequently by third party applications and is generally no longer supported on Twitter . |
35,531 | public function getGeoId ( $ placeId , array $ parameters = array ( ) , $ multipart = false , $ appOnlyAuth = false ) { return $ this -> get ( "geo/id/{$placeId}" , $ parameters , $ multipart , $ appOnlyAuth ) ; } | Returns all the information about a known place . |
35,532 | public function index ( User $ user , Collection $ areaProvidersCollection ) { $ items = [ ] ; foreach ( $ areaProvidersCollection as $ areaProviders ) { $ enabled = $ areaProviders -> getEnabledModel ( ) ; if ( ! $ enabled instanceof Provider ) { continue ; } $ area = $ areaProviders -> getArea ( ) ; if ( $ enabled -> isForced ( ) ) { $ items [ ] = [ 'area' => $ area , 'line' => trans ( 'antares/two_factor_auth::configuration.activated' ) , ] ; } elseif ( $ this -> userProviderConfigService -> hasEnabledArea ( $ area ) ) { $ url = handles ( 'two_factor_auth.user.configuration.disable' , compact ( 'area' , 'user' ) ) ; $ attrs = [ 'class' => 'triggerable confirm' , 'data-title' => trans ( 'antares/two_factor_auth::configuration.disable.title' ) , 'data-description' => trans ( 'antares/two_factor_auth::configuration.disable.prompt' ) , 'data-icon' => 'minus' , ] ; $ items [ ] = [ 'area' => $ area , 'line' => HTML :: link ( $ url , trans ( 'antares/two_factor_auth::configuration.disable.label' ) , $ attrs ) , ] ; } else { $ url = handles ( 'two_factor_auth.user.configuration.enable' , compact ( 'area' , 'user' ) ) ; $ attrs = [ 'class' => 'triggerable confirm' , 'data-title' => trans ( 'antares/two_factor_auth::configuration.enable.title' ) , 'data-description' => trans ( 'antares/two_factor_auth::configuration.enable.prompt' ) , 'data-icon' => 'minus' , ] ; $ items [ ] = [ 'area' => $ area , 'line' => HTML :: link ( $ url , trans ( 'antares/two_factor_auth::configuration.enable.label' ) , $ attrs ) , ] ; } } return $ items ; } | Returns an array with supported areas and link . |
35,533 | public function configure ( UserConfig $ user , AreaContract $ area , Provider $ provider ) { return $ this -> formFactory -> of ( 'antares.two_factor_auth.provider.auth.configure' , function ( FormGrid $ form ) use ( $ user , $ area , $ provider ) { $ url = handles ( 'two_factor_auth.user.post.configuration' , compact ( 'area' ) ) ; $ form -> simple ( $ url ) ; $ form -> name ( 'Two-Factor Authentication User Settings Form' ) ; $ form -> layout ( 'antares/two_factor_auth::admin.auth.partials._form' ) ; $ form -> hidden ( 'provider_id' , function ( $ field ) use ( $ provider ) { $ field -> value = $ provider -> getId ( ) ; } ) ; $ form -> hidden ( 'user_id' , function ( $ field ) use ( $ user ) { $ field -> value = $ user -> getId ( ) ; } ) ; $ title = trans ( 'antares/two_factor_auth::auth.configuration' ) ; $ form -> fieldset ( $ title , function ( Fieldset $ fieldset ) use ( $ user , $ provider ) { $ provider -> getProviderGateway ( ) -> setupFrontendFormFieldset ( $ fieldset , $ user ) ; $ fieldset -> control ( 'button' , 'button' ) -> attributes ( [ 'type' => 'submit' , 'class' => 'btn btn-primary' ] ) -> value ( trans ( 'Continue' ) ) ; $ fieldset -> control ( 'button' , 'cancel' ) -> field ( function ( ) { return app ( 'html' ) -> link ( handles ( 'two_factor_auth.get.cancel' , [ 'area' => area ( ) ] ) , trans ( 'cancel' ) , [ 'class' => 'btn btn--md btn--default mdl-button mdl-js-button' ] ) ; } ) ; } ) ; } ) ; } | Returns a form for a frontend page where Two - Factor Auth should be configured for first use . |
35,534 | public function send ( $ path , $ value , $ timestamp = null ) { $ result = false ; $ exception = null ; set_error_handler ( function ( $ code , $ message , $ file = null , $ line = 0 ) { throw new ErrorException ( $ message , $ code , null , $ file , $ line ) ; } ) ; try { if ( ! is_string ( $ path ) || empty ( $ path ) ) { throw new InvalidArgumentException ( '$path must be a non-empty string' ) ; } if ( ! is_numeric ( $ value ) ) { throw new InvalidArgumentException ( sprintf ( '$value must be of type int|float, %s given.' , gettype ( $ value ) ) ) ; } $ value = ( float ) $ value ; $ timestamp = is_numeric ( $ timestamp ) ? ( int ) $ timestamp : time ( ) ; $ full_path = $ this -> sanitizePath ( sprintf ( '%s.%s' , $ this -> getNamespace ( ) , $ path ) ) ; $ data = sprintf ( "%s %f %d\n" , $ full_path , $ value , $ timestamp ) ; $ sent = fwrite ( $ this -> stream , $ data ) ; $ result = is_int ( $ sent ) && $ sent === strlen ( $ data ) ; } catch ( Exception $ e ) { $ exception = $ e ; } restore_error_handler ( ) ; if ( ! empty ( $ exception ) && $ this -> throw_exceptions ) { throw $ exception ; } return $ result ; } | Sends a metric to Carbon . |
35,535 | public function sanitizePath ( $ string ) { if ( ! is_string ( $ string ) || empty ( $ string ) ) { return '' ; } $ replace = [ '/\s+/' => '_' , '/\*{1,}/' => '' , '/\.{2,}/' => '.' , '/^\./' => '' , '/\.$/' => '' , ] ; return preg_replace ( array_keys ( $ replace ) , array_values ( $ replace ) , trim ( $ string ) ) ; } | Sanitizes a path string |
35,536 | static public function getParents ( $ className ) { $ parents = [ ] ; $ parent = new \ ReflectionClass ( $ className ) ; while ( true ) { $ parent = $ parent -> getParentClass ( ) ; if ( ! $ parent ) { break ; } else { $ parents [ ] = $ parent -> getName ( ) ; } } return $ parents ; } | Returns all parents of a class . |
35,537 | public static function fromReflection ( ReflectionDocComment $ reflectionDocComment ) { $ annotations = array ( ) ; foreach ( $ reflectionDocComment -> getAnnotationsCollection ( ) -> getAnnotations ( ) as $ reflectionTag ) { $ annotations [ ] = BaseTag :: fromReflection ( $ reflectionTag ) ; } return new static ( $ reflectionDocComment -> getShortDescription ( ) , $ reflectionDocComment -> getLongDescription ( ) , $ annotations ) ; } | Create a new documentation comment from reflection . |
35,538 | public function setShortDescription ( $ description ) { $ description = trim ( $ description ) ; if ( $ description === '' ) { $ this -> shortDescription = null ; } else { $ this -> shortDescription = $ description ; } return $ this ; } | Set the short description . |
35,539 | public function setLongDescription ( $ description ) { $ description = trim ( $ description ) ; if ( $ description === '' ) { $ this -> longDescription = null ; } else { $ this -> longDescription = $ description ; } return $ this ; } | Set the long description . |
35,540 | private function assertValidHashAlgorithm ( KeyConfiguration $ keyConfig ) { if ( ! \ in_array ( $ keyConfig -> getHashAlgorithm ( ) , hash_algos ( ) , true ) ) { throw new UnknownHashAlgorithmException ( $ keyConfig -> getHashAlgorithm ( ) ) ; } } | Assert that hash algorithm is valid . |
35,541 | private function assertValidKeyConfiguration ( KeyConfiguration $ keyConfig ) { if ( empty ( $ keyConfig -> getHashAlgorithm ( ) ) || empty ( $ keyConfig -> getSalt ( ) ) || empty ( $ keyConfig -> getCost ( ) ) ) { throw new InvalidKeyConfigurationException ( ) ; } $ this -> assertValidHashAlgorithm ( $ keyConfig ) ; } | Assert that key configuration is valid . |
35,542 | public function properties ( $ map ) { foreach ( $ map as $ name => $ type ) $ this -> _properties [ $ name ] = new Property ( $ name , $ type ) ; return $ this ; } | Sets the schema properties chainable |
35,543 | public function events ( $ map ) { foreach ( $ map as $ name => $ callback ) $ this -> _events -> register ( $ name , $ callback ) ; return $ this ; } | Sets the schema events |
35,544 | public function build ( $ class ) { if ( ! isset ( $ this -> _properties ) ) throw new Exception ( "A schema must have properties" ) ; return new Schema ( $ class , array ( 'properties' => $ this -> _properties , 'relationships' => $ this -> _relationships , 'getters' => $ this -> _getters , 'setters' => $ this -> _setters , 'events' => $ this -> _events ) ) ; } | Builds a schema object |
35,545 | protected function generatePropertiesLines ( ) { $ code = array ( ) ; foreach ( $ this -> properties as $ property ) { $ property -> setIndentationString ( $ this -> getIndentationString ( ) ) ; $ property -> setIndentationLevel ( $ this -> getIndentationLevel ( ) + 1 ) ; $ code [ ] = $ property -> generate ( ) ; $ code [ ] = null ; } return $ code ; } | Generate the properties lines . |
35,546 | public function convert ( $ value ) { if ( ! is_object ( $ value ) ) return $ value ; return $ this -> formatter ( $ value ) -> format ( $ value ) ; } | Convert a value using to the appropriate format |
35,547 | public function formatter ( $ object ) { $ interfaces = class_implements ( $ object ) ; foreach ( $ interfaces as $ interface ) { $ class = $ this -> getClassName ( $ interface ) ; if ( isset ( $ this -> formatters [ $ class ] ) ) { return $ this -> formatters [ $ class ] ; } } $ class = $ this -> getClassName ( get_class ( $ object ) ) ; return $ this -> formatters [ $ class ] ; } | Get the Formatter for an object |
35,548 | public function compare ( Type $ left , Type $ right ) { return $ right -> accept ( new TypeEquivalenceComparatorVisitor ( $ this , $ left ) ) ; } | Compare the supplied types for equivalence . |
35,549 | public function with ( $ relations = [ ] ) { if ( ! is_array ( $ relations ) ) { $ relations = [ $ relations ] ; } $ this -> with = $ relations ; return $ this ; } | Load page relations |
35,550 | public function findBySlug ( $ slug ) { return $ this -> model -> whereSlug ( $ slug ) -> with ( $ this -> with ) -> first ( ) ; } | Find news by unique identifier |
35,551 | public function tree ( ) { $ items = $ this -> model -> orderBy ( 'id' ) -> orderBy ( 'parent_id' ) -> with ( $ this -> with ) -> get ( [ 'id' , 'title' , 'parent_id' ] ) -> toArray ( ) ; return $ this -> toTree ( $ items ) ; } | Fetch pages tree |
35,552 | protected function toTree ( array $ dataSet = [ ] ) { $ tree = [ ] ; $ references = [ ] ; foreach ( $ dataSet as $ id => & $ node ) { $ references [ $ node [ 'id' ] ] = & $ node ; $ node [ 'children' ] = [ ] ; if ( is_null ( $ node [ 'parent_id' ] ) ) { $ tree [ $ node [ 'id' ] ] = & $ node ; } else { $ references [ $ node [ 'parent_id' ] ] [ 'children' ] [ $ node [ 'id' ] ] = & $ node ; } } return $ tree ; } | Transform dataSet to a tree |
35,553 | protected function toList ( array $ items = [ ] , $ level = 0 ) { $ prefix = str_repeat ( ' ' , $ level ) ; $ pages = [ ] ; foreach ( $ items as $ item ) { $ pages [ $ item [ 'id' ] ] = $ prefix . '' . $ item [ 'title' ] ; if ( $ item [ 'children' ] ) { $ pages += $ this -> toList ( $ item [ 'children' ] , $ level + 1 ) ; } } return $ pages ; } | Transform tree to list |
35,554 | public function getCounts ( ) { $ log = AccessLog :: all ( ) -> groupBy ( 'user_id' ) ; $ counts = [ ] ; $ all = 0 ; foreach ( $ log as $ l ) { $ first = $ l [ 0 ] ; $ user = $ first -> user ? $ first -> user : $ this -> getDeletedFakeUser ( ) ; $ size = sizeof ( $ l ) ; $ counts [ ] = [ 'size' => $ size , 'id' => $ first -> user_id , 'name' => $ user -> username ] ; $ all += $ size ; } return [ 'all' => $ all , 'counts' => $ counts ] ; } | Get data for widget |
35,555 | public function getIssuers ( ) { if ( $ this -> isSuccessful ( ) ) { $ issuers = [ ] ; foreach ( $ this -> data [ 'payment_methods' ] [ 'ideal' ] [ 'metadata' ] [ 'issuers' ] as $ key => $ value ) { $ issuers [ ] = new Issuer ( $ key , $ value , 'ideal' ) ; } return $ issuers ; } return [ ] ; } | Get the returned list of issuers . |
35,556 | protected function checkAndExtractModelFile ( ) { if ( ! is_readable ( $ file = $ this -> argument ( 'modelfile' ) ) ) { throw new \ InvalidArgumentException ( 'Could not find the model.' ) ; } $ archive = new \ ZipArchive ( ) ; if ( ! $ archive -> open ( realpath ( $ file ) ) ) { throw new \ InvalidArgumentException ( 'Could not open the model.' ) ; } $ dir = sys_get_temp_dir ( ) . DIRECTORY_SEPARATOR . uniqid ( ) . DIRECTORY_SEPARATOR ; if ( ! $ archive -> extractTo ( $ dir ) ) { throw new \ InvalidArgumentException ( 'Could not extract the model.' ) ; } return $ dir ; } | Checks and extract the model file . If the file can be found and extracted the extracted path will be returned . |
35,557 | protected function createTableRelations ( array $ tables ) { foreach ( $ tables as $ tableObject ) { $ tableObject -> relateToOtherTables ( $ tables ) ; } return $ this -> sortTablesWithFKsToEnd ( $ tables ) ; } | Creates the relations between the tables . |
35,558 | public function fire ( ) { $ this -> loadMNTables ( ) ; $ dir = $ this -> checkAndExtractModelFile ( ) ; foreach ( glob ( $ dir . '*.mwb.xml' ) as $ file ) { $ reader = new MWBModelReader ( ) ; $ reader -> open ( $ file ) ; $ this -> setModelReader ( $ reader ) -> handleModelTables ( ) ; } return null ; } | Opens the zipped model container and reads the xml model file . |
35,559 | public function getModelTables ( ) { if ( $ this -> tables === null ) { $ this -> setModelTables ( $ this -> loadModelTables ( ) ) ; } return $ this -> tables ; } | Returns the loaded model tables . |
35,560 | protected function handleModelTables ( ) { if ( ! $ this -> getModelReader ( ) -> isCompatibleVersion ( ) ) { throw new \ InvalidArgumentException ( 'Wrong model version.' ) ; } $ bar = $ this -> output -> createProgressBar ( ) ; $ bar -> start ( count ( $ tables = $ this -> getModelTables ( ) ) ) ; foreach ( $ this -> createTableRelations ( $ tables ) as $ tableObject ) { $ tableObject -> save ( $ this ) ; $ bar -> advance ( ) ; } return $ this ; } | Loads the model tables out of the model file . |
35,561 | protected function loadModelTables ( ) { $ reader = $ this -> getModelReader ( ) ; $ tables = [ ] ; while ( $ reader -> read ( ) ) { if ( $ reader -> isModelTable ( ) ) { if ( $ table = $ this -> loadModelTable ( $ reader -> expand ( ) ) ) { $ tables [ $ table -> getId ( ) ] = $ table ; } } } return $ tables ; } | Loads the model tables from the file . |
35,562 | protected function sortTablesWithFKsToEnd ( array $ tables ) { $ return = [ ] ; while ( $ tables ) { foreach ( $ tables as $ key => $ table ) { if ( ( ! $ fks = $ table -> getForeignKeys ( ) ) || ( count ( array_intersect_key ( $ return , $ fks ) ) === count ( $ fks ) ) ) { $ return [ $ table -> getName ( ) ] = $ table ; unset ( $ tables [ $ key ] ) ; } } } return $ return ; } | Callback to sort tables with foreign keys to the end . |
35,563 | public function enable ( User $ user , $ area ) { $ area = app ( AreaManager :: class ) -> getById ( $ area ) ; request ( ) -> session ( ) -> set ( 'return_url' , request ( ) -> headers -> get ( 'referer' ) ) ; return $ this -> processor -> enable ( $ this , $ user , $ area ) ; } | Enable the available provider in the area for the user . |
35,564 | public function disable ( User $ user , $ area ) { $ area = app ( AreaManager :: class ) -> getById ( $ area ) ; return $ this -> processor -> disable ( $ this , $ user , $ area ) ; } | Disable the available provider in the area for the user . |
35,565 | public function postConfiguration ( $ area ) { $ area = app ( AreaManager :: class ) -> getById ( $ area ) ; return $ this -> processor -> markAsConfigured ( $ this , $ area ) ; } | Mark an area configuration as configured . |
35,566 | public function visitObjectType ( ObjectType $ type ) { $ difference = $ this -> comparePrimaryType ( $ type ) ; if ( 0 !== $ difference ) { return $ difference ; } return $ this -> compareAttribute ( $ this -> type -> ofType ( ) , $ type -> ofType ( ) ) ; } | Visit an object type . |
35,567 | public function verify ( UserConfig $ user , AreaContract $ area , Provider $ provider , $ secretKey = null ) { return $ this -> formFactory -> of ( 'antares.two_factor_auth.provider.auth.verify' , function ( FormGrid $ form ) use ( $ user , $ area , $ provider , $ secretKey ) { $ form -> simple ( handles ( 'two_factor_auth.post.verify' , compact ( 'area' ) ) ) ; $ form -> name ( 'Two-Factor Authentication User Verification Form' ) ; $ form -> layout ( 'antares/two_factor_auth::admin.auth.partials._form' ) ; $ form -> hidden ( 'provider_id' , function ( $ field ) use ( $ provider ) { $ field -> value = $ provider -> getId ( ) ; } ) ; $ form -> hidden ( 'user_id' , function ( $ field ) use ( $ user ) { $ field -> value = $ user -> getId ( ) ; } ) ; $ form -> hidden ( 'secret_key' , function ( $ field ) use ( $ secretKey ) { $ field -> value = $ secretKey ; } ) ; $ title = trans ( 'antares/two_factor_auth::auth.verify' ) ; $ form -> fieldset ( $ title , function ( Fieldset $ fieldset ) use ( $ user , $ provider ) { $ provider -> getProviderGateway ( ) -> setupVerifyFormFieldset ( $ fieldset , $ user ) ; $ fieldset -> control ( 'button' , 'button' ) -> attributes ( [ 'type' => 'submit' , 'class' => 'btn btn-primary' ] ) -> value ( trans ( 'Submit & Save' ) ) ; if ( ! $ user -> configured ) { $ fieldset -> control ( 'button' , 'cancel' ) -> field ( function ( ) { return app ( 'html' ) -> link ( handles ( 'two_factor_auth.get.configuration' , [ 'area' => area ( ) ] ) , trans ( 'Go Back' ) , [ 'class' => 'btn btn--md btn--default mdl-button mdl-js-button' ] ) ; } ) ; } } ) ; } ) ; } | Returns a form for a Two - Factor Auth login page . |
35,568 | protected function renderToggleGroup ( ToggleGroup $ group ) { $ groupLabel = $ group -> getLabel ( ) ; $ this -> table -> addCell ( $ groupLabel ) ; $ toggles = '' ; foreach ( $ group as $ toggle ) { $ toggles .= $ toggle -> getLabel ( ) . $ toggle -> render ( $ this ) ; } $ this -> table -> addCell ( $ toggles ) ; $ this -> table -> addRow ( ) ; return '' ; } | Renders a ToggleGroup into the table |
35,569 | public function renderFieldset ( Fieldset $ fieldset ) { $ fieldsetRenderer = new static ( $ this -> csrfProvider ) ; foreach ( $ fieldset as $ item ) { $ fieldsetRenderer -> render ( $ item ) ; } $ content = $ fieldsetRenderer -> getRenderedForm ( ) ; $ tag = Html :: tag ( 'fieldset' , $ fieldset -> getAttributes ( ) , $ content ) ; $ cell = new Table \ Cell ( $ tag ) ; $ cell -> setAttributes ( [ 'colspan' => 2 ] ) ; $ this -> table -> addCell ( $ cell ) ; $ this -> table -> addRow ( ) ; return '' ; } | Adds a fieldset object to the table . |
35,570 | public function addParameter ( ParameterGenerator $ parameter ) { $ name = $ parameter -> getName ( ) ; if ( isset ( $ this -> parameters [ $ name ] ) === true ) { throw new InvalidArgumentException ( 'A parameter with the name "' . $ name . '" is already added.' ) ; } $ this -> parameters [ $ name ] = $ parameter ; return $ this ; } | Add a parameter to the entity . |
35,571 | public function addUses ( $ uses ) { foreach ( $ uses as $ use ) { if ( is_string ( $ use ) === true ) { $ this -> addUse ( $ use ) ; } elseif ( is_array ( $ use ) === true ) { $ this -> addUse ( $ use [ 0 ] , $ use [ 1 ] ) ; } } return $ this ; } | Add the uses . |
35,572 | protected function renderUsesLines ( ) { $ code = array ( ) ; $ indentation = $ this -> getIndentation ( ) ; foreach ( $ this -> uses as $ use => $ alias ) { if ( $ alias === null ) { $ code [ ] = $ indentation . 'use ' . $ use . ';' ; } else { $ code [ ] = $ indentation . 'use ' . $ use . ' as ' . $ alias . ';' ; } } if ( count ( $ this -> uses ) > 0 ) { $ code [ ] = null ; } return $ code ; } | Render the uses . |
35,573 | protected function loadSyliusUser ( $ userType , $ email ) { if ( empty ( $ email ) ) { return null ; } $ userRepository = $ this -> getContainer ( ) -> get ( sprintf ( 'sylius.repository.%s_user' , $ userType ) ) ; return $ userRepository -> findOneByEmail ( $ email ) ; } | Loads the Sylius user from the repo . |
35,574 | protected function loadEzUser ( $ login ) { if ( empty ( $ login ) ) { return null ; } $ userService = $ this -> getContainer ( ) -> get ( 'ezpublish.api.service.user' ) ; try { return $ userService -> loadUserByLogin ( $ login ) ; } catch ( NotFoundException $ e ) { return null ; } } | Loads the eZ Platform user from the repo . |
35,575 | public function parse ( $ source , & $ offset = 0 ) { $ tokens = $ this -> lexer -> tokens ( $ source , $ offset ) ; $ type = $ this -> parseTokens ( $ tokens , $ index ) ; $ offset += self :: offset ( $ tokens , $ index ) ; return $ type ; } | Parse the supplied source into a type . |
35,576 | public static function offset ( array $ tokens , $ index ) { if ( count ( $ tokens ) < 1 ) { return 0 ; } if ( null === $ index ) { $ index = count ( $ tokens ) - 1 ; } $ source = '' ; for ( $ i = 0 ; $ i < $ index ; ++ $ i ) { $ source .= $ tokens [ $ i ] -> content ( ) ; } return strlen ( $ source ) ; } | Calculate the offset from a list of tokens . |
35,577 | public function addMethod ( MethodGenerator $ method ) { $ name = $ method -> getName ( ) ; if ( isset ( $ this -> methods [ $ name ] ) === true ) { throw new InvalidArgumentException ( 'Method name "' . $ name . '" already added.' ) ; } $ this -> methods [ $ name ] = $ method ; } | Add a method . |
35,578 | public function getMethod ( $ name ) { if ( $ this -> hasMethod ( $ name ) === true ) { return $ this -> methods [ $ name ] ; } else { throw new InvalidArgumentException ( 'Method "' . $ name . '" is not defined.' ) ; } } | Get a method definition . |
35,579 | protected function generateMethodsLines ( ) { $ code = array ( ) ; foreach ( $ this -> methods as $ method ) { $ method -> setIndentationString ( $ this -> getIndentationString ( ) ) ; $ method -> setIndentationLevel ( $ this -> getIndentationLevel ( ) + 1 ) ; $ code [ ] = $ method -> generate ( ) ; $ code [ ] = null ; } return $ code ; } | Generate the methods lines . |
35,580 | public function verify ( AuthListener $ listener , AreaContract $ area ) { $ provider = $ this -> service -> getEnabledInArea ( $ area ) ; $ userConfig = $ this -> userConfigService -> getSettingsByArea ( $ area ) ; $ form = $ this -> presenter -> verify ( $ userConfig , $ area , $ provider ) ; return $ listener -> showVerifyForm ( $ provider , $ form ) ; } | Show verify form for given area . |
35,581 | public function verifyCredentials ( AuthListener $ listener , AreaContract $ area , array $ input ) { $ provider = $ this -> service -> getEnabledInArea ( $ area ) ; $ userConfig = $ this -> userConfigService -> getSettingsByArea ( $ area ) ; if ( ! $ provider -> getProviderGateway ( ) -> isVerified ( $ userConfig , $ input ) ) { return $ listener -> verifyFailed ( ) ; } $ this -> userConfigService -> setAsConfigured ( $ userConfig ) ; $ this -> service -> getAuthStore ( ) -> verify ( ) ; return $ listener -> authenticate ( $ area ) ; } | Verify provider credentials . |
35,582 | public function generate ( ) { return trim ( '@' . $ this -> getAccess ( ) . ' ' . $ this -> getType ( ) . ' $' . $ this -> getPropertyName ( ) . ' ' . $ this -> description ) ; } | Generate the annotation tag . |
35,583 | public function generateDocumentation ( ) { if ( $ this -> documentation !== null ) { $ this -> documentation -> setIndentationString ( $ this -> getIndentationString ( ) ) ; $ this -> documentation -> setIndentationLevel ( $ this -> getIndentationLevel ( ) ) ; return $ this -> documentation -> generate ( ) ; } else { return null ; } } | Generate the documentation . |
35,584 | public function build ( $ definition , $ context = null , $ name = null ) { if ( $ definition instanceof ProviderInterface ) { return $ this -> getProviderValue ( $ definition , $ context ) ; } elseif ( $ definition instanceof FieldInterface ) { return $ definition -> getResult ( $ context ) ; } elseif ( is_array ( $ definition ) ) { $ result = [ ] ; foreach ( $ definition as $ key => $ value ) { $ result [ $ key ] = $ this -> build ( $ value , $ context ) ; } return new Record ( $ name === null ? 'record' : $ name , $ result ) ; } elseif ( is_string ( $ definition ) ) { if ( $ context !== null ) { if ( is_array ( $ context ) ) { if ( array_key_exists ( $ definition , $ context ) ) { return $ context [ $ definition ] ; } else { throw new RuntimeException ( 'Referenced unknown key "' . $ definition . '" in context' ) ; } } elseif ( $ context instanceof \ ArrayAccess ) { if ( $ context -> offsetExists ( $ definition ) ) { return $ context -> offsetGet ( $ definition ) ; } else { throw new RuntimeException ( 'Referenced unknown key "' . $ definition . '" in context' ) ; } } else { throw new RuntimeException ( 'Context must be either an array or instance of ArrayAccess' ) ; } } else { return $ definition ; } } else { return $ definition ; } } | Returns an array based on the resolved definition |
35,585 | public static function combinePath ( ) { $ argsCount = \ func_num_args ( ) ; $ args = \ func_get_args ( ) ; if ( $ argsCount > 0 ) { if ( $ argsCount == 1 ) { return $ args [ 0 ] ; } else { $ res = "" ; foreach ( $ args as $ arg ) { $ res .= $ arg . \ DIRECTORY_SEPARATOR ; } $ res = \ rtrim ( $ res , \ DIRECTORY_SEPARATOR ) ; return $ res ; } } return null ; } | combine path parts cross platform |
35,586 | public static function getCorePath ( $ alias , $ core ) { return self :: normalizePath ( self :: combinePath ( self :: getAliasPath ( $ alias ) , $ core ) ) ; } | get core directory path |
35,587 | public static function replaceInFile ( $ filename , $ replacements ) { $ content = \ file_get_contents ( $ filename ) ; foreach ( $ replacements as $ find => $ replace ) { $ content = \ str_replace ( $ find , $ replace , $ content ) ; } \ file_put_contents ( $ filename , $ content ) ; } | replace file content |
35,588 | public static function checkPatternMatchFileList ( $ fileList , $ pattern ) { foreach ( $ fileList as $ filename ) { if ( self :: checkFilePattern ( $ filename , $ pattern ) ) return true ; } return false ; } | check if pattern find in file list |
35,589 | public static function getFileCounts ( $ path , $ ignoreList ) { $ path = self :: normalizePath ( $ path ) ; $ count = 0 ; $ dir = \ opendir ( $ path ) ; while ( false !== ( $ file = \ readdir ( $ dir ) ) ) { $ fullPath = self :: normalizePath ( self :: combinePath ( $ path , $ file ) ) ; $ relativePath = self :: normalizePath ( \ str_replace ( self :: normalizePath ( \ base_path ( ) . '/' ) , '' , $ fullPath ) ) ; if ( ( $ file != '.' ) && ( $ file != '..' ) && ! ( self :: checkPatternMatchFileList ( $ ignoreList , $ relativePath ) ) ) { if ( \ is_dir ( $ fullPath ) ) { $ count += self :: getFileCounts ( $ fullPath , $ ignoreList ) ; } else { $ count ++ ; } } } \ closedir ( $ dir ) ; return $ count ; } | get file count in directory |
35,590 | public static function copyFiles ( $ src , $ dst , $ callback = null , $ ignoreList ) { $ src = self :: normalizePath ( $ src ) ; $ dst = self :: normalizePath ( $ dst ) ; $ dir = \ opendir ( $ src ) ; @ \ mkdir ( $ dst , 0777 , true ) ; while ( false !== ( $ file = \ readdir ( $ dir ) ) ) { $ fullPathSrc = self :: normalizePath ( self :: combinePath ( $ src , $ file ) ) ; $ fullPathDst = self :: normalizePath ( self :: combinePath ( $ dst , $ file ) ) ; $ relativePath = self :: normalizePath ( \ str_replace ( self :: normalizePath ( \ base_path ( ) . '/' ) , '' , $ fullPathSrc ) ) ; if ( ( $ file != '.' ) && ( $ file != '..' ) && ! ( self :: checkPatternMatchFileList ( $ ignoreList , $ relativePath ) ) ) { if ( \ is_dir ( $ fullPathSrc ) ) { self :: copyFiles ( $ fullPathSrc , $ fullPathDst , $ callback , $ ignoreList ) ; } else { @ \ copy ( $ fullPathSrc , $ fullPathDst ) ; if ( \ is_callable ( $ callback ) ) { \ call_user_func ( $ callback ) ; } } } } \ closedir ( $ dir ) ; } | copy file from source directory to destination directory recursive |
35,591 | public static function deleteFiles ( $ dir ) { $ dir = self :: normalizePath ( $ dir ) ; if ( \ is_dir ( $ dir ) ) { $ files = \ scandir ( $ dir ) ; foreach ( $ files as $ file ) { $ fullPath = self :: normalizePath ( self :: combinePath ( $ dir , $ file ) ) ; if ( $ file != "." && $ file != ".." ) { if ( \ is_dir ( $ fullPath ) ) self :: deleteFiles ( $ fullPath ) ; else @ \ unlink ( $ fullPath ) ; } } @ \ rmdir ( $ dir ) ; } return true ; } | delete directory recursive |
35,592 | public function getFiles ( $ dir ) { $ dir = self :: normalizePath ( $ dir ) ; $ files = scandir ( $ dir ) ; $ results = [ ] ; foreach ( $ files as $ key => $ value ) { $ path = self :: normalizePath ( self :: combinePath ( $ dir , $ value ) ) ; if ( ! is_dir ( $ path ) ) { $ results [ ] = $ path ; } else if ( $ value != "." && $ value != ".." ) { $ results = array_merge ( $ results , getDirContents ( $ path ) ) ; } } return $ results ; } | get all files in directory recursive |
35,593 | public function getUriRouteFor ( string $ method ) : ? Route { if ( ! $ this -> isMethodAllowed ( $ method ) ) { return null ; } return $ this -> uriRoutes [ $ method ] ; } | Returns the route for the given method if it exists . |
35,594 | public function seek ( $ position ) { if ( $ position < 0 ) { throw new \ OutOfBoundsException ( "Unable to seek to negative offset $position" ) ; } if ( $ this -> _position !== $ position ) { if ( ( $ count = $ this -> _result -> num_rows ) && ( $ position > ( $ count - 1 ) ) ) throw new \ OutOfBoundsException ( "Unable to seek to offset $position" ) ; if ( $ count ) { $ this -> _result -> data_seek ( $ this -> _position = $ position ) ; $ this -> _currentRow = $ this -> _fetch ( ) ; } $ this -> _position = $ position ; } } | Seeks to a particular position in the result offset is from 0 . |
35,595 | private function _fetch ( ) { return isset ( $ this -> _hydrator ) ? call_user_func ( $ this -> _hydrator , $ this -> _result -> fetch_array ( MYSQLI_ASSOC ) ) : $ this -> _result -> fetch_array ( MYSQLI_ASSOC ) ; } | Template for fetching the array |
35,596 | protected function createResult ( Route $ route , ServerRequestInterface $ request , array $ matches ) : Match { $ attributes = $ route -> getAttributes ( ) ; foreach ( $ attributes as $ index => $ attribute ) { $ name = $ attribute -> getName ( ) ; if ( array_key_exists ( $ index , $ matches ) ) { $ request = $ request -> withAttribute ( $ name , $ matches [ $ index ] ) ; } } return new Match ( $ route , $ request ) ; } | Creates a match . |
35,597 | public function panelGroupOptions ( $ dataContainer = null ) : array { $ columns [ ] = 'tl_content.type = ?' ; $ values [ ] = 'bs_panel_group_start' ; if ( $ dataContainer ) { $ columns [ ] = 'tl_content.pid = ?' ; $ columns [ ] = 'tl_content.ptable = ?' ; $ columns [ ] = 'tl_content.sorting < ?' ; $ values [ ] = $ dataContainer -> activeRecord -> pid ; $ values [ ] = $ dataContainer -> activeRecord -> ptable ; $ values [ ] = $ dataContainer -> activeRecord -> sorting ; } $ collection = $ this -> repository -> findBy ( $ columns , $ values , [ 'order' => 'tl_content.sorting ASC' ] ) ; $ options = [ ] ; if ( $ collection ) { foreach ( $ collection as $ model ) { $ options [ $ model -> id ] = sprintf ( '%s [%s]' , $ model -> bs_panel_name , $ model -> id ) ; } } return $ options ; } | Get the panel group options . |
35,598 | public function generatePanelName ( $ value , $ dataContainer ) : string { if ( ! $ value ) { $ value = 'panel_' . $ dataContainer -> activeRecord -> id ; } return $ value ; } | Generate a panel name if not given . |
35,599 | public static function getFinder ( Request $ request , $ contentPath ) { $ requestUri = $ request -> getPathInfo ( ) ; if ( false !== ( strpos ( $ requestUri , '.' ) || strpos ( $ requestUri , '?' ) ) ) { return false ; } if ( $ requestUri == '/' ) { return new Finder ( $ contentPath ) ; } return new Finder ( $ contentPath . $ requestUri ) ; } | Get property file name from request uri and base content path |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.