idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
57,000 | public function getDataByItems ( array $ items ) { $ output = [ ] ; foreach ( $ items as $ item ) { try { $ output [ ] = $ this -> getDataByItem ( $ item ) ; } catch ( ExtractorException $ e ) { \ common_Logger :: e ( 'ERROR on item ' . $ item -> getUri ( ) . ' : ' . $ e -> getMessage ( ) ) ; } } if ( empty ( $ output ... | Loop all items and call extract function |
57,001 | public function getDataByItem ( \ core_kernel_classes_Resource $ item ) { foreach ( $ this -> columns as $ column => $ config ) { $ extractor = $ this -> extractors [ $ config [ 'extractor' ] ] ; if ( isset ( $ config [ 'parameters' ] ) ) { $ parameters = $ config [ 'parameters' ] ; } else { $ parameters = [ ] ; } $ ex... | Loop foreach columns and extract data thought extractors |
57,002 | public function save ( array $ headers , array $ data ) { $ output = $ contents = [ ] ; $ enclosure = $ this -> getCsvEnclosure ( ) ; $ delimiter = $ this -> getCsvDelimiter ( ) ; $ contents [ ] = $ enclosure . implode ( $ enclosure . $ delimiter . $ enclosure , $ headers ) . $ enclosure ; if ( ! empty ( $ data ) ) { f... | Save data to file |
57,003 | protected function getCsvEnclosure ( ) { if ( $ this -> hasOption ( self :: CSV_ENCLOSURE_OPTION ) ) { return $ this -> getOption ( self :: CSV_ENCLOSURE_OPTION ) ; } return self :: CSV_ENCLOSURE ; } | Get the CSV enclosure from config if not set use default value |
57,004 | protected function getCsvDelimiter ( ) { if ( $ this -> hasOption ( self :: CSV_DELIMITER_OPTION ) ) { return $ this -> getOption ( self :: CSV_DELIMITER_OPTION ) ; } return self :: CSV_DELIMITER ; } | Get the CSV delimiter from config if not set use default value |
57,005 | static public function getSourcePath ( ) { return [ LomMetadata :: LOM_NAMESPACE . '#lom' , LomMetadata :: LOM_NAMESPACE . '#classification' , LomMetadata :: LOM_NAMESPACE . '#taxonPath' , LomMetadata :: LOM_NAMESPACE . '#source' , LomMetadata :: LOM_NAMESPACE . '#string' ] ; } | Get the default classification source path |
57,006 | public function packItem ( core_kernel_classes_Resource $ item , $ lang , Directory $ directory ) { $ content = $ this -> getXmlByItem ( $ item , $ lang ) ; $ qtiParser = new QtiParser ( $ content ) ; $ qtiParser -> validate ( ) ; if ( ! $ qtiParser -> isValid ( ) ) { throw new common_Exception ( 'Invalid QTI content :... | packItem implementation for QTI |
57,007 | protected function createQtiService ( core_kernel_classes_Resource $ item , tao_models_classes_service_StorageDirectory $ publicDirectory , tao_models_classes_service_StorageDirectory $ privateDirectory ) { $ service = new tao_models_classes_service_ServiceCall ( new core_kernel_classes_Resource ( self :: INSTANCE_ITEM... | Create a servicecall that runs the prepared qti item |
57,008 | public function save ( ) { if ( ! tao_helpers_Request :: isAjax ( ) ) { throw new common_exception_IsAjaxAction ( __METHOD__ ) ; } if ( ! $ this -> hasRequestParameter ( 'uri' ) ) { throw new common_exception_MissingParameter ( 'uri' , __METHOD__ ) ; } if ( ! $ this -> hasRequestParameter ( 'stylesheetUri' ) ) { throw ... | Save custom CSS as file |
57,009 | public function load ( ) { if ( ! $ this -> hasRequestParameter ( 'uri' ) ) { throw new common_exception_MissingParameter ( 'uri' , __METHOD__ ) ; } if ( ! $ this -> hasRequestParameter ( 'stylesheetUri' ) ) { throw new common_exception_MissingParameter ( 'stylesheetUri' , __METHOD__ ) ; } if ( ! $ this -> hasRequestPa... | Load the custom styles as JSON |
57,010 | private function getCssArray ( ) { if ( ! $ this -> hasRequestParameter ( 'cssJson' ) ) { throw new common_exception_MissingParameter ( 'cssJson' , __CLASS__ . '::' . \ Context :: getInstance ( ) -> getActionName ( ) ) ; } $ cssArr = json_decode ( $ _POST [ 'cssJson' ] , true ) ; if ( ! is_array ( $ cssArr ) ) { throw ... | Convert CSS JSON to array |
57,011 | public function download ( ) { if ( ! $ this -> hasRequestParameter ( 'uri' ) ) { throw new common_exception_MissingParameter ( 'uri' , __METHOD__ ) ; } if ( ! $ this -> hasRequestParameter ( 'stylesheetUri' ) ) { throw new common_exception_MissingParameter ( 'stylesheetUri' , __METHOD__ ) ; } if ( ! $ this -> hasReque... | Download custom styles |
57,012 | public function setResourceIdentifier ( $ resourceIdentifier ) { if ( is_string ( $ resourceIdentifier ) === false ) { $ msg = "The resourceIdentifier argument must be a string." ; throw new InvalidArgumentException ( $ msg ) ; } elseif ( $ resourceIdentifier === '' ) { $ msg = "The resourceIdentifier argument must be ... | Set the identifier of the resource the MetadataValue describes . |
57,013 | public function setPath ( array $ path ) { if ( count ( $ path ) === 0 ) { $ msg = "The path argument must be a non-empty array." ; throw new InvalidArgumentException ( $ msg ) ; } else { $ this -> path = $ path ; } } | Set the descriptive path of the MetadataValue . |
57,014 | public function inject ( $ identifier , $ target ) { if ( $ this -> hasMetadataValue ( $ identifier ) ) { \ common_Logger :: i ( __ ( 'Preparing Metadata Values for target "%s"...' , $ identifier ) ) ; $ values = $ this -> getMetadataValue ( $ identifier ) ; foreach ( $ this -> getInjectors ( ) as $ injector ) { \ comm... | Inject metadata value for an identifier through injectors |
57,015 | public function unregister ( $ key , $ name ) { if ( empty ( $ key ) || empty ( $ name ) ) { throw new \ common_Exception ( ) ; } if ( is_object ( $ name ) ) { $ name = get_class ( $ name ) ; } switch ( $ key ) { case self :: EXTRACTOR_KEY : $ this -> unregisterInstance ( self :: EXTRACTOR_KEY , $ name ) ; break ; case... | Unregister a instance of metadataService config |
57,016 | protected function registerInstance ( $ key , $ name , $ interface ) { if ( is_a ( $ name , $ interface , true ) ) { $ instances = $ this -> getOption ( $ key ) ; if ( $ instances === null || array_search ( $ name , $ instances ) === false ) { $ instances [ ] = $ name ; $ this -> setOption ( $ key , $ instances ) ; $ t... | Register an instance |
57,017 | protected function unregisterInstance ( $ key , $ name ) { if ( $ this -> hasOption ( $ key ) ) { $ instances = $ this -> getOption ( $ key ) ; if ( ( $ index = array_search ( $ name , $ instances ) ) !== false ) { unset ( $ instances [ $ index ] ) ; $ this -> setOption ( $ key , $ instances ) ; $ this -> registerMetad... | Unregister an instance |
57,018 | protected function getInstances ( $ id , $ interface ) { if ( isset ( $ this -> instances [ $ id ] ) ) { return $ this -> instances [ $ id ] ; } $ this -> instances [ $ id ] = [ ] ; if ( ! $ this -> hasOption ( $ id ) ) { return $ this -> instances [ $ id ] ; } else { foreach ( $ this -> getOption ( $ id ) as $ instanc... | Return config instances |
57,019 | public function getModel ( $ modelId ) { if ( ! $ this -> isRegistered ( $ modelId ) ) { throw new PortableModelMissing ( $ modelId ) ; } return $ this -> getModelFromConfig ( $ this -> get ( $ modelId ) ) ; } | Return model associated to the given string value |
57,020 | public function getModels ( ) { $ models = $ this -> getMap ( ) ; foreach ( $ models as $ key => $ config ) { $ models [ $ key ] = $ this -> getModelFromConfig ( $ config ) ; } return $ models ; } | Return all configured models |
57,021 | public function getRuntimePath ( ) { $ paths = [ ] ; foreach ( $ this -> getRuntime ( ) as $ key => $ value ) { if ( in_array ( $ key , [ 'hook' , 'libraries' , 'stylesheets' , 'mediaFiles' , 'icon' , 'src' ] ) ) { $ paths [ $ key ] = preg_replace ( '/^' . $ this -> getTypeIdentifier ( ) . '/' , '.' , $ value ) ; } } r... | Return runtime files with relative path |
57,022 | public function getCreatorPath ( ) { $ paths = [ ] ; foreach ( $ this -> getCreator ( ) as $ key => $ value ) { if ( in_array ( $ key , [ 'hook' , 'libraries' , 'stylesheets' , 'mediaFiles' , 'icon' , 'src' ] ) ) { $ paths [ $ key ] = preg_replace ( '/^' . $ this -> getTypeIdentifier ( ) . '/' , '.' , $ value ) ; } } r... | Return creator files with relative path |
57,023 | public function submitResponses ( ) { $ success = false ; $ itemUri = $ this -> getItemUri ( ) ; if ( ! empty ( $ itemUri ) ) { $ this -> processResponses ( new core_kernel_classes_Resource ( $ itemUri ) ) ; $ success = true ; } else { throw new common_Exception ( 'missing required itemId' ) ; } } | The main entry poin for respon evaluation |
57,024 | protected function updateItem ( \ oat \ taoQtiItem \ model \ qti \ Item $ item , $ itemFile ) { $ changed = false ; $ responses = $ item -> getResponses ( ) ; foreach ( $ responses as $ response ) { $ responseIdentifier = $ response -> attr ( 'identifier' ) ; $ rules = $ response -> getFeedbackRules ( ) ; foreach ( $ r... | Update the item content by wrapping the modalfeedback body into a new wrapper |
57,025 | public function key ( ) { if ( ! $ this -> valid ( ) ) { return null ; } if ( $ this -> mode & self :: KEY_AS_KEY ) { return parent :: key ( ) ; } return $ this -> cursor ; } | Returns the current position . |
57,026 | public function accept ( ) { $ path = ( $ this -> mode & self :: FILTER_VALUE ) ? $ this -> current ( ) : parent :: key ( ) ; if ( 0 !== strpos ( $ path , $ this -> staticPrefix ) ) { return false ; } $ result = ( bool ) preg_match ( $ this -> regExp , $ path ) ; return $ result ; } | Accepts paths matching the glob . |
57,027 | public static function glob ( $ glob , $ flags = 0 ) { $ results = iterator_to_array ( new GlobIterator ( $ glob , $ flags ) ) ; sort ( $ results ) ; return $ results ; } | Globs the file system paths matching the glob . |
57,028 | public static function match ( $ path , $ glob , $ flags = 0 ) { if ( ! self :: isDynamic ( $ glob ) ) { return $ glob === $ path ; } if ( 0 !== strpos ( $ path , self :: getStaticPrefix ( $ glob , $ flags ) ) ) { return false ; } if ( ! preg_match ( self :: toRegEx ( $ glob , $ flags ) , $ path ) ) { return false ; } ... | Matches a path against a glob . |
57,029 | public static function filter ( array $ paths , $ glob , $ flags = self :: FILTER_VALUE ) { if ( ( $ flags & self :: FILTER_VALUE ) && ( $ flags & self :: FILTER_KEY ) ) { throw new InvalidArgumentException ( 'The flags Glob::FILTER_VALUE and Glob::FILTER_KEY cannot be passed at the same time.' ) ; } if ( ! self :: isD... | Filters an array for paths matching a glob . |
57,030 | public static function getBasePath ( $ glob , $ flags = 0 ) { $ staticPrefix = self :: getStaticPrefix ( $ glob , $ flags ) ; if ( false !== ( $ pos = strrpos ( $ staticPrefix , '/' ) ) ) { if ( 0 === $ pos ) { return '/' ; } if ( $ pos - 3 === strpos ( $ glob , '://' ) ) { return substr ( $ staticPrefix , 0 , $ pos + ... | Returns the base path of a glob . |
57,031 | public static function isDynamic ( $ glob ) { return false !== strpos ( $ glob , '*' ) || false !== strpos ( $ glob , '{' ) || false !== strpos ( $ glob , '?' ) || false !== strpos ( $ glob , '[' ) ; } | Returns whether the glob contains a dynamic part . |
57,032 | final protected function getContextChoices ( ) { $ contextChoices = [ ] ; foreach ( $ this -> contextManager -> findAll ( ) as $ context ) { $ contextChoices [ $ context -> getId ( ) ] = $ context -> getName ( ) ; } return $ contextChoices ; } | Returns a context choice array . |
57,033 | protected function handleWriteTag ( $ request , $ id = null ) { $ tag = $ id ? $ this -> getTag ( $ id ) : null ; $ form = $ this -> formFactory -> createNamed ( null , 'sonata_classification_api_form_tag' , $ tag , [ 'csrf_protection' => false , ] ) ; FormHelper :: removeFields ( $ request -> request -> all ( ) , $ fo... | Write a tag this method is used by both POST and PUT action methods . |
57,034 | public function deleteCategoryAction ( $ id ) { $ category = $ this -> getCategory ( $ id ) ; $ this -> categoryManager -> delete ( $ category ) ; return [ 'deleted' => true ] ; } | Deletes a category . |
57,035 | protected function handleWriteCategory ( $ request , $ id = null ) { $ category = $ id ? $ this -> getCategory ( $ id ) : null ; $ form = $ this -> formFactory -> createNamed ( null , 'sonata_classification_api_form_category' , $ category , [ 'csrf_protection' => false , ] ) ; FormHelper :: removeFields ( $ request -> ... | Write a category this method is used by both POST and PUT action methods . |
57,036 | public function deleteContextAction ( $ id ) { $ context = $ this -> getContext ( $ id ) ; $ this -> contextManager -> delete ( $ context ) ; return [ 'deleted' => true ] ; } | Deletes a context . |
57,037 | protected function handleWriteContext ( $ request , $ id = null ) { $ context = $ id ? $ this -> getContext ( $ id ) : null ; $ form = $ this -> formFactory -> createNamed ( null , 'sonata_classification_api_form_context' , $ context , [ 'csrf_protection' => false , ] ) ; FormHelper :: removeFields ( $ request -> reque... | Write a context this method is used by both POST and PUT action methods . |
57,038 | protected function handleWriteCollection ( $ request , $ id = null ) { $ collection = $ id ? $ this -> getCollection ( $ id ) : null ; $ form = $ this -> formFactory -> createNamed ( null , 'sonata_classification_api_form_collection' , $ collection , [ 'csrf_protection' => false , ] ) ; FormHelper :: removeFields ( $ r... | Write a collection this method is used by both POST and PUT action methods . |
57,039 | public function getRootCategoriesPager ( $ page = 1 , $ limit = 25 , $ criteria = [ ] ) { $ page = 0 === ( int ) $ page ? 1 : ( int ) $ page ; $ queryBuilder = $ this -> getObjectManager ( ) -> createQueryBuilder ( ) -> select ( 'c' ) -> from ( $ this -> class , 'c' ) -> andWhere ( 'c.parent IS NULL' ) ; $ pager = new ... | Returns a pager to iterate over the root category . |
57,040 | protected function loadCategories ( ContextInterface $ context ) { if ( \ array_key_exists ( $ context -> getId ( ) , $ this -> categories ) ) { return ; } $ class = $ this -> getClass ( ) ; $ categories = $ this -> getObjectManager ( ) -> createQuery ( sprintf ( 'SELECT c FROM %s c WHERE c.context = :context ORDER BY ... | Load all categories from the database the current method is very efficient for < 256 categories . |
57,041 | public function allowCache ( ResponseInterface $ response , $ type = 'private' , $ maxAge = null , $ mustRevalidate = false ) { if ( ! in_array ( $ type , [ 'private' , 'public' ] ) ) { throw new InvalidArgumentException ( 'Invalid Cache-Control type. Must be "public" or "private".' ) ; } $ headerValue = $ type ; if ( ... | Enable client - side HTTP caching |
57,042 | public function withExpires ( ResponseInterface $ response , $ time ) { if ( ! is_integer ( $ time ) ) { $ time = strtotime ( $ time ) ; if ( $ time === false ) { throw new InvalidArgumentException ( 'Expiration value could not be parsed with `strtotime()`.' ) ; } } return $ response -> withHeader ( 'Expires' , gmdate ... | Add Expires header to PSR7 response object |
57,043 | public function withEtag ( ResponseInterface $ response , $ value , $ type = 'strong' ) { if ( ! in_array ( $ type , [ 'strong' , 'weak' ] ) ) { throw new InvalidArgumentException ( 'Invalid etag type. Must be "strong" or "weak".' ) ; } $ value = '"' . $ value . '"' ; if ( $ type === 'weak' ) { $ value = 'W/' . $ value... | Add ETag header to PSR7 response object |
57,044 | public function setApiVersion ( $ apiVersion ) { if ( ! in_array ( $ apiVersion = intval ( $ apiVersion ) , $ this -> getSupportedApiVersions ( ) ) ) { throw new UnsupportedApiVersionException ( ) ; } $ this -> apiVersion = $ apiVersion ; } | Set API version |
57,045 | protected function isValidBroadcastType ( $ broadcastType ) { $ validBroadcastTypes = [ 'archive' , 'highlight' , 'upload' ] ; $ broadcastTypeArray = explode ( ',' , $ broadcastType ) ; foreach ( $ broadcastTypeArray as $ type ) { if ( ! in_array ( $ type , $ validBroadcastTypes ) ) { return false ; } } return true ; } | Return true if the provided broadcast type is valid |
57,046 | public function getChannelChatBadges ( $ channelIdentifier ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> get ( sprintf ( 'chat/%s/badges' , $ channelIdentifier ) ) ; } | Get chat badges by channel |
57,047 | public function getChatEmoticonSets ( $ emotesets = null ) { if ( $ emotesets && ! is_string ( $ emotesets ) ) { throw new InvalidTypeException ( 'emotesets' , 'string' , gettype ( $ emotesets ) ) ; } $ emotesets = trim ( $ emotesets , ', ' ) ; return $ this -> get ( 'chat/emoticon_images' , [ 'emotesets' => $ emoteset... | Get chat emoticons by set |
57,048 | public function getAuthenticationUrl ( $ state = null , $ forceVerify = false ) { return implode ( '' , [ sprintf ( '%soauth2/authorize' , $ this -> baseUri ) , '?response_type=code' , sprintf ( '&client_id=%s' , $ this -> getClientId ( ) ) , sprintf ( '&redirect_uri=%s' , $ this -> getRedirectUri ( ) ) , sprintf ( '&s... | Get the Twitch OAuth URL |
57,049 | public function getAccessCredentials ( $ code , $ state = null ) { return $ this -> post ( 'oauth2/token' , [ 'client_id' => $ this -> getClientId ( ) , 'client_secret' => $ this -> getClientSecret ( ) , 'grant_type' => 'authorization_code' , 'redirect_uri' => $ this -> getRedirectUri ( ) , 'code' => $ code , 'state' =... | Get a user s access credentials which includes the access token |
57,050 | public function getMultipleFeedPosts ( $ channelIdentifier , $ accessToken , $ limit = 10 , $ cursor = null , $ comments = 5 ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! $ this -> isValidLimit ( $ limit ) ) { t... | Get multiple feed posts |
57,051 | public function getFeedPost ( $ channelIdentifier , $ postId , $ accessToken , $ comments = 5 ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! is_string ( $ postId ) ) { throw new InvalidTypeException ( 'Post ID' ,... | Get a feed post |
57,052 | public function createFeedPost ( $ channelIdentifier , $ accessToken , $ content , $ share = false ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! is_string ( $ content ) ) { throw new InvalidTypeException ( 'Cont... | Create a fedd post |
57,053 | public function deleteFeedPost ( $ channelIdentifier , $ postId , $ accessToken ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! is_string ( $ postId ) ) { throw new InvalidTypeException ( 'Post ID' , 'string' , ge... | Delete a feed post |
57,054 | public function getFeedComments ( $ channelIdentifier , $ postId , $ accessToken , $ limit = 10 , $ cursor = null ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! is_string ( $ postId ) ) { throw new InvalidTypeExc... | Get comments from a feed post |
57,055 | public function createFeedComment ( $ channelIdentifier , $ postId , $ accessToken , $ comment ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! is_string ( $ comment ) ) { throw new InvalidTypeException ( 'Comment'... | Create a feed post comment |
57,056 | public function deleteFeedComment ( $ channelIdentifier , $ postId , $ commentId , $ accessToken ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> delete ( sprintf ( 'feed/%s/posts/%s/comments/%s' , $ chan... | Delete a feed post comment |
57,057 | public function createFeedCommentReaction ( $ channelIdentifier , $ postId , $ commentId , $ accessToken , $ emoteId ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! is_string ( $ postId ) ) { throw new InvalidType... | Create a reaction to a feed comment |
57,058 | public function deleteFeedCommentReaction ( $ channelIdentifier , $ postId , $ commentId , $ accessToken , $ emoteId ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! is_string ( $ postId ) ) { throw new InvalidType... | Delete a reaction to a feed comment |
57,059 | public function getTopGames ( $ limit = 10 , $ offset = 0 ) { if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( ! $ this -> isValidOffset ( $ offset ) ) { throw new InvalidOffsetException ( ) ; } $ params = [ 'limit' => $ limit , 'offset' => $ offset , ] ; return $ this -> get (... | Get top games |
57,060 | public function getCommunityByName ( $ name ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_string ( $ name ) ) { throw new InvalidTypeException ( 'Name' , 'string' , gettype ( $ name ) ) ; } return $ this -> get ( 'communities' , [ 'name' => ... | Get community by name |
57,061 | public function getCommunityById ( $ communityId ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_string ( $ communityId ) ) { throw new InvalidTypeException ( 'Community ID' , 'string' , gettype ( $ communityId ) ) ; } return $ this -> get ( s... | Get community by ID |
57,062 | public function createCommunity ( $ name , $ summary , $ description , $ rules , $ accessToken ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( strlen ( $ name ) < 3 || strlen ( $ name ) > 25 ) { throw new InvalidParameterLengthException ( 'name' ) ... | Create a community |
57,063 | public function updateCommunity ( $ communityId , $ accessToken , $ summary = null , $ description = null , $ rules = null , $ email = null ) { $ params = [ ] ; if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( $ summary ) { if ( strlen ( $ summary ) > 1... | Update a community |
57,064 | public function getTopCommunities ( $ limit = 10 , $ cursor = null ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( $ cursor && ! is_string ( $ cursor ) ) { throw ... | Get top communities |
57,065 | public function getBannedCommunityUsers ( $ communityId , $ accessToken , $ limit = 10 , $ cursor = null ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( $ cursor ... | Get banned community users |
57,066 | public function deleteCommunityAvatar ( $ communityId , $ accessToken ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } return $ this -> delete ( sprintf ( 'communities/%s/images/avatar' , $ communityId ) , [ ] , $ accessToken ) ; } | Delete a community avatar image |
57,067 | public function deleteCommunityCoverImage ( $ communityId , $ accessToken ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } return $ this -> delete ( sprintf ( 'communities/%s/images/cover' , $ communityId ) , [ ] , $ accessToken ) ; } | Delete a community cover image |
57,068 | public function addCommunityModerator ( $ communityId , $ userId , $ accessToken ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_numeric ( $ userId ) ) { throw new InvalidIdentifierException ( 'user' ) ; } return $ this -> put ( sprintf ( 'com... | Give a community user moderator permissions |
57,069 | public function removeCommunityModerator ( $ communityId , $ userId , $ accessToken ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_numeric ( $ userId ) ) { throw new InvalidIdentifierException ( 'user' ) ; } return $ this -> delete ( sprintf ... | Remove moderator permission from a community user |
57,070 | public function getCommunityPermissions ( $ communityId , $ accessToken ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } return $ this -> get ( sprintf ( 'communities/%s/permissions' , $ communityId ) , [ ] , $ accessToken ) ; } | Get community permissions |
57,071 | public function reportCommunityViolation ( $ communityId , $ channelId ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_numeric ( $ channelId ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> post ( sprintf ( 'commun... | Report a community channel violation |
57,072 | public function timeoutCommunityUser ( $ communityId , $ userId , $ accessToken , $ duration , $ reason = null ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_numeric ( $ userId ) ) { throw new InvalidIdentifierException ( 'user' ) ; } if ( ! ... | Timeout a community user |
57,073 | public function getVideo ( $ videoIdentifier ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ videoIdentifier ) ) { throw new InvalidIdentifierException ( 'video' ) ; } return $ this -> get ( sprintf ( 'videos/%s' , $ videoIdentifier ) ) ; } | Get a video |
57,074 | public function getTopVideos ( $ limit = 10 , $ offset = 0 , $ game = null , $ period = 'week' , $ broadcastType = 'highlight' ) { $ validPeriods = [ 'week' , 'month' , 'all' ] ; if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( ! $ this -> isValidOffset ( $ offset ) ) { throw n... | Get top videos |
57,075 | public function getFollowedChannelsVideos ( $ accessToken , $ limit = 10 , $ offset = 0 , $ broadcastType = 'highlight' ) { if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( ! $ this -> isValidOffset ( $ offset ) ) { throw new InvalidOffsetException ( ) ; } $ broadcastType = tri... | Get the videos from channels followed by the authenticated user |
57,076 | public function getClip ( $ slug ) { if ( ! is_string ( $ slug ) ) { throw new InvalidTypeException ( 'Slug' , 'string' , gettype ( $ slug ) ) ; } return $ this -> get ( sprintf ( 'clips/%s' , $ slug ) ) ; } | Get a clip |
57,077 | public function getTopClips ( $ channel = null , $ cursor = null , $ game = null , $ limit = 10 , $ period = 'day' , $ trending = false , $ language = null ) { $ validPeriods = [ 'day' , 'week' , 'month' , 'all' ] ; if ( $ channel ) { if ( ! is_string ( $ channel ) ) { throw new InvalidTypeException ( 'channel' , 'stri... | Get top clips |
57,078 | public function getFollowedClips ( $ accessToken , $ limit = 10 , $ cursor = null , $ trending = false ) { if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( $ cursor && ! is_string ( $ cursor ) ) { throw new InvalidTypeException ( 'cursor' , 'string' , gettype ( $ cursor ) ) ; }... | Get clips from channels followed |
57,079 | protected function getNewHttpClient ( $ method , $ params , $ accessToken = null ) { $ config = [ 'http_errors' => $ this -> getHttpErrors ( ) , 'base_uri' => $ this -> baseUri , 'timeout' => $ this -> getTimeout ( ) , 'headers' => [ 'Client-ID' => $ this -> getClientId ( ) , 'Accept' => sprintf ( 'application/vnd.twit... | Get a new HTTP Client |
57,080 | public function getStreamByUser ( $ userIdendifier , $ streamType = 'live' ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ userIdendifier ) ) { throw new InvalidIdentifierException ( 'user' ) ; } if ( ! $ this -> isValidStreamType ( $ streamType ) ) { throw new InvalidStreamTypeException ( ) ; } re... | Get the stream information for a user |
57,081 | public function getLiveStreams ( $ channel = null , $ game = null , $ language = null , $ streamType = 'live' , $ limit = 25 , $ offset = 0 , $ broadcaster_language = null ) { if ( $ channel ) { if ( ! is_string ( $ channel ) ) { throw new InvalidTypeException ( 'channel' , 'string' , gettype ( $ channel ) ) ; } $ chan... | Get live streams |
57,082 | public function getStreamsSummary ( $ game = null ) { if ( $ game && ! is_string ( $ game ) ) { throw new InvalidTypeException ( 'game' , 'string' , gettype ( $ game ) ) ; } return $ this -> get ( 'streams/summary' , [ 'game' => $ game ] ) ; } | Gets a summary of live streams |
57,083 | public function getFeaturedStreams ( $ limit = 25 , $ offset = 0 ) { if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( ! $ this -> isValidOffset ( $ offset ) ) { throw new InvalidOffsetException ( ) ; } $ params = [ 'limit' => intval ( $ limit ) , 'offset' => intval ( $ offset )... | Get a list of all featured live streams |
57,084 | public function getFollowedStreams ( $ asccessToken , $ streamType = 'live' , $ limit = 25 , $ offset = 0 ) { if ( ! $ this -> isValidStreamType ( $ streamType ) ) { throw new InvalidStreamTypeException ( ) ; } if ( ! $ this -> isValidLimit ( $ limit ) ) { throw new InvalidLimitException ( ) ; } if ( ! $ this -> isVali... | Get followed streams |
57,085 | public function getChannel ( $ channelIdentifier ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> get ( sprintf ( 'channels/%s' , $ channelIdentifier ) ) ; } | Get a channel |
57,086 | public function updateChannel ( $ channelIdentifier , $ accessToken , $ status = null , $ game = null , $ delay = null , $ channelFeedEnabled = null ) { $ params = [ ] ; $ params [ 'channel' ] = [ ] ; if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierExc... | Update a user s channel |
57,087 | public function getChannelEditors ( $ channelIdentifier , $ accessToken ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> get ( sprintf ( 'channels/%s/editors' , $ channelIdentifier ) , [ ] , $ accessToken... | Get channel editors |
57,088 | public function getChannelFollowers ( $ channelIdentifier , $ limit = 25 , $ offset = 0 , $ cursor = null , $ direction = 'desc' ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! $ this -> isValidLimit ( $ limit ) )... | Get channel followers |
57,089 | public function getChannelTeams ( $ channelIdentifier ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> get ( sprintf ( 'channels/%s/teams' , $ channelIdentifier ) ) ; } | Get channel teams |
57,090 | public function getChannelSubscribers ( $ channelIdentifier , $ accessToken , $ limit = 25 , $ offset = 0 , $ direction = 'desc' ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! $ this -> isValidLimit ( $ limit ) )... | Get channel subscribers |
57,091 | public function getChannelVideos ( $ channelIdentifier , $ limit = 10 , $ offset = 0 , $ broadcastType = 'highlight' , $ language = null , $ sort = 'time' ) { $ validSort = [ 'views' , 'time' ] ; if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierExceptio... | Get channel videos |
57,092 | public function startChannelCommercial ( $ channelIdentifier , $ accessToken , $ length = 30 ) { $ validLengths = [ 30 , 60 , 90 , 120 , 150 , 180 ] ; if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } if ( ! in_array ( $ lengt... | Run a channel commercial |
57,093 | public function resetChannelStreamKey ( $ channelIdentifier , $ accessToken ) { if ( $ this -> apiVersionIsGreaterThanV3 ( ) && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> delete ( sprintf ( 'channels/%s/stream_key' , $ channelIdentifier ) , [ ] , $ a... | Reset a channel s stream key |
57,094 | public function getChannelCommunity ( $ channelIdentifier ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> get ( sprintf ( 'channels/%s/... | Get the community for a channel |
57,095 | public function setChannelCommunity ( $ channelIdentifier , $ communityId , $ accessToken ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this ... | Set the community for a channel |
57,096 | public function deleteChannelFromCommunity ( $ channelIdentifier , $ accessToken ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } return $ this -> delete... | Remove a channel form a community |
57,097 | public function getTeam ( $ name ) { if ( ! is_string ( $ name ) ) { throw new InvalidTypeException ( 'Name' , 'string' , gettype ( $ name ) ) ; } return $ this -> get ( sprintf ( 'teams/%s' , $ name ) ) ; } | Get a team by name |
57,098 | public function getCheermotes ( $ channelIdentifier = null ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( $ channelIdentifier && ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'channel' ) ; } $ params = [ 'channel_... | Get a list of cheermotes |
57,099 | public function getChannelCollection ( $ channelIdentifier , $ limit = 10 , $ cursor = null , $ containingItem = null ) { if ( ! $ this -> apiVersionIsGreaterThanV3 ( ) ) { throw new EndpointNotSupportedByApiVersionException ( ) ; } if ( ! is_numeric ( $ channelIdentifier ) ) { throw new InvalidIdentifierException ( 'c... | Get all collections owned by a channel |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.