idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
15,500
protected function smtp_send ( $ data , $ expecting , $ return_number = false ) { ! is_array ( $ expecting ) and $ expecting !== false and $ expecting = array ( $ expecting ) ; stream_set_timeout ( $ this -> smtp_connection , $ this -> config [ 'smtp' ] [ 'timeout' ] ) ; if ( ! fputs ( $ this -> smtp_connection , $ dat...
Sends data to the SMTP host
15,501
protected function smtp_get_response ( ) { $ data = '' ; stream_set_timeout ( $ this -> smtp_connection , $ this -> config [ 'smtp' ] [ 'timeout' ] ) ; while ( $ str = fgets ( $ this -> smtp_connection , 512 ) ) { $ info = stream_get_meta_data ( $ this -> smtp_connection ) ; if ( $ info [ 'timed_out' ] ) { throw new \ ...
Get SMTP response
15,502
public function getOauthCallback ( $ service ) { $ user = \ Socialite :: driver ( $ service ) -> user ( ) ; $ email = $ user -> getEmail ( ) ; $ dbUser = \ User :: where ( 'email' , $ email ) -> first ( ) ; if ( ! $ dbUser ) { $ userInfo = [ 'name' => $ user -> getName ( ) , config ( 'taki.field.email' ) => $ user -> g...
Create user or log the user in after success authentication
15,503
public function readKeys ( $ offset , $ direction , $ hints = Parser :: HINT_NONE ) { $ shiftedOffset = $ direction == self :: DIRECTION_BACKWARD ? $ offset - $ this -> getReadLength ( ) : $ offset ; if ( $ shiftedOffset < 0 ) { $ shiftedOffset = 0 ; } \ fseek ( $ this -> index -> getFile ( ) -> getFilePointer ( ) , $ ...
Returns keys from a offset
15,504
public function without ( $ element ) { if ( $ element instanceof \ ArrayAccess ) { $ filtered_element = clone $ element ; } else { $ filtered_element = $ element ; } $ args = func_get_args ( ) ; unset ( $ args [ 0 ] ) ; foreach ( $ args as $ arg ) { if ( isset ( $ filtered_element [ $ arg ] ) ) { unset ( $ filtered_el...
This is a carbon copy of the drupal Twig without filter .
15,505
protected function createSchemas ( array $ configuration ) { $ processor = new Processor ( ) ; $ processedConfiguration = $ processor -> processConfiguration ( new SchemaConfiguration ( ) , $ configuration ) ; $ schemas = array ( ) ; foreach ( $ processedConfiguration as $ schemaName => $ schemaConfig ) { $ schema = ne...
Creates and returns a Schema from the given configuration array .
15,506
private function validateDefinitionConfig ( $ name , array & $ config ) { if ( true === $ config [ 'virtual' ] && 0 === count ( $ config [ 'property_paths' ] ) ) { throw new \ InvalidArgumentException ( sprintf ( '"property_paths" must be set for "virtual" characteristic "%s".' , $ name ) ) ; } if ( $ config [ 'type' ]...
Validates the definition configuration .
15,507
public function getIterator ( ) { $ iterator = new AppendIterator ; if ( $ this -> wrapped_object instanceof IteratorAggregate ) { $ iterator -> append ( $ element -> getIterator ( ) ) ; } else { $ iterator -> append ( new ArrayIterator ( $ this -> wrapped_object ) ) ; } $ iterator -> append ( parent :: getIterator ( )...
Returns an AppendIterator that iterates over both the wrapped object and this object
15,508
public static function make ( array $ server = null ) { if ( empty ( $ server ) ) { $ server = $ _SERVER ; } $ headers = [ ] ; $ content = [ 'CONTENT_TYPE' => 'Content-Type' , 'CONTENT_LENGTH' => 'Content-Length' , 'CONTENT_MD5' => 'Content-Md5' , ] ; foreach ( $ server as $ key => $ value ) { if ( substr ( $ key , 0 ,...
Makes an array of headers .
15,509
public static function getDomainFromURL ( $ url ) { $ url = str_replace ( self :: getProtocolFromURL ( $ url ) . '://' , '' , $ url ) ; return explode ( '/' , $ url ) [ 0 ] ; }
Extracts the domain from a URL
15,510
public static function getPathFromURL ( $ url ) { $ path = str_replace ( self :: getProtocolFromURL ( $ url ) . '://' , '' , $ url ) ; $ path = str_replace ( self :: getDomainFromURL ( $ url ) , '' , $ path ) ; if ( $ path == '' ) return '/' ; return $ path ; }
Extracts the path from a URL
15,511
public function validateValue ( $ value ) { $ valid = is_string ( $ value ) && strlen ( $ value ) <= 254 && ( preg_match ( $ this -> pattern , $ value ) || $ this -> allowName && preg_match ( $ this -> fullPattern , $ value ) ) ; return $ valid ; }
Validates a static value to see if it is a valid email .
15,512
public function validateClass ( $ attribute , $ params ) { $ className = @ \ Yii :: import ( $ this -> $ attribute , true ) ; if ( ! is_string ( $ className ) || ! $ this -> classExists ( $ className ) ) { $ this -> addError ( $ attribute , "Class '$className' does not exist or has syntax error." ) ; } elseif ( isset (...
Validates the base class to make sure that it exists and that it extends from the core class .
15,513
public function validateReservedKeyword ( $ attribute , $ params ) { if ( $ this -> isReservedKeyword ( $ this -> $ attribute ) ) { $ this -> addError ( $ attribute , $ this -> getAttributeLabel ( $ attribute ) . ' cannot be a reserved PHP keyword.' ) ; } }
Validates an attribute to make sure it is not a reserved PHP keyword .
15,514
public function getApiModel ( string $ p_model ) : \ FreeFW \ Core \ Model { $ class = str_replace ( '_' , '::Model::' , $ p_model ) ; return \ FreeFW \ DI \ DI :: get ( $ class ) ; }
Get new model
15,515
protected function store ( $ updateNulls = false ) { $ row = TableRow :: create ( ) ; foreach ( $ this -> getFields ( ) as $ fieldName => $ fieldInfos ) { $ fieldValue = $ this -> row -> get ( $ fieldName ) ; switch ( $ fieldInfos -> Type ) { case 'bigint' : case 'mediumint' : case 'smallint' : case 'tinyint' : $ field...
Store the record
15,516
protected function hasBeenModified ( TableRow $ oldRow ) { $ diff = $ this -> row -> diff ( $ oldRow ) ; $ this -> hasBeenModified = ( count ( $ diff ) > 0 ) ; return $ this -> hasBeenModified ; }
Chec if the record has been modified .
15,517
protected function getFields ( ) { $ fields = $ this -> db -> getTableColumns ( $ this -> tbl ) ; if ( empty ( $ fields ) ) { throw new TableException ( 'Table columns not found' ) ; } return $ fields ; }
Get the object fields from database table columns
15,518
protected function setFieldsTypeByName ( ) { foreach ( $ this -> getFields ( ) as $ fieldName => $ fieldInfos ) { $ v = $ this -> row -> get ( $ fieldName ) ; switch ( $ fieldInfos -> Type ) { case 'bigint' : case 'mediumint' : case 'smallint' : case 'tinyint' : case 'int' : $ this -> row -> set ( $ fieldName , ( int )...
Set data type for known fields
15,519
protected function realPkSelection ( & $ pk ) { if ( null === $ pk ) { $ pk = $ this -> row -> get ( $ this -> tbl_key ) ; } if ( null === $ pk ) { $ this -> setError ( DatabaseHelper :: getTranslation ( 'NO_ITEM_SELECTED' ) ) ; return false ; } return true ; }
Set the real pk request value
15,520
public function callbackAction ( $ callbackUri ) { try { $ this -> authenticationManager -> authenticate ( ) ; } catch ( \ TYPO3 \ Flow \ Security \ Exception \ AuthenticationRequiredException $ exception ) { $ authenticationException = $ exception ; } if ( $ this -> authenticationManager -> isAuthenticated ( ) ) { $ s...
Receive an SSO authentication callback and trigger authentication through the SingleSignOnProvider .
15,521
public static function guessMimeType ( $ filename , $ default = 'application/octed-stream' ) { $ guesser = new FileExtMimeTypeGuesser ( ) ; $ mime = $ guesser -> guess ( $ filename ) ; if ( null === $ mime ) { try { $ mime = MimeTypeGuesser :: getInstance ( ) -> guess ( $ filename ) ; } catch ( FileNotFoundException $ ...
Guesses the mimetype by the files extension ... or default
15,522
public static function containsDotfile ( $ path ) { $ path = Path :: canonicalize ( Path :: makeAbsolute ( $ path , '/' ) ) ; return preg_match ( '#/\.#' , $ path ) == 1 ; }
Returns true if the path conatains any dotfile access
15,523
public function getClassPath ( $ class ) { $ segments = explode ( '_' , $ class ) ; $ namespaceTopLevel = $ this -> getNamespace ( ) ; $ namespace = '' ; if ( ! empty ( $ namespaceTopLevel ) ) { $ namespace = array ( ) ; $ topLevelSegments = count ( explode ( '_' , $ namespaceTopLevel ) ) ; for ( $ i = 0 ; $ i < $ topL...
Helper method to calculate the correct class path
15,524
public function setOptions ( array $ options ) { if ( isset ( $ options [ 'namespace' ] ) ) { $ this -> setNamespace ( $ options [ 'namespace' ] ) ; unset ( $ options [ 'namespace' ] ) ; } $ methods = get_class_methods ( $ this ) ; foreach ( $ options as $ key => $ value ) { $ method = 'set' . ucfirst ( $ key ) ; if ( ...
Set class state from options
15,525
public function addResourceType ( $ type , $ path , $ namespace = null ) { $ type = strtolower ( $ type ) ; if ( ! isset ( $ this -> _resourceTypes [ $ type ] ) ) { if ( null === $ namespace ) { throw new Zend_Loader_Exception ( 'Initial definition of a resource type must include a namespace' ) ; } $ namespaceTopLevel ...
Add resource type
15,526
public function addResourceTypes ( array $ types ) { foreach ( $ types as $ type => $ spec ) { if ( ! is_array ( $ spec ) ) { throw new Zend_Loader_Exception ( 'addResourceTypes() expects an array of arrays' ) ; } if ( ! isset ( $ spec [ 'path' ] ) ) { throw new Zend_Loader_Exception ( 'addResourceTypes() expects each ...
Add multiple resources at once
15,527
public function removeResourceType ( $ type ) { if ( $ this -> hasResourceType ( $ type ) ) { $ namespace = $ this -> _resourceTypes [ $ type ] [ 'namespace' ] ; unset ( $ this -> _components [ $ namespace ] ) ; unset ( $ this -> _resourceTypes [ $ type ] ) ; } return $ this ; }
Remove the requested resource type
15,528
public function load ( $ resource , $ type = null ) { if ( null === $ type ) { $ type = $ this -> getDefaultResourceType ( ) ; if ( empty ( $ type ) ) { throw new Zend_Loader_Exception ( 'No resource type specified' ) ; } } if ( ! $ this -> hasResourceType ( $ type ) ) { throw new Zend_Loader_Exception ( 'Invalid resou...
Object registry and factory
15,529
protected function setDebugMode ( $ debug ) { error_reporting ( 0 ) ; if ( $ debug ) { error_reporting ( E_ALL ) ; ini_set ( 'display_errors' , true ) ; ini_set ( 'display_startup_errors' , true ) ; } }
Set old debug mode
15,530
protected function buildErrors ( ) { if ( $ this -> hasErrors ( ) ) { echo implode ( PHP_EOL , $ this -> getErrors ( ) ) ; echo PHP_EOL , $ this -> opts -> getUsageMessage ( ) ; } return $ this ; }
Method build and show error message
15,531
public function log ( $ message , $ priority , $ extras = null ) { if ( null !== $ this -> getLogger ( ) ) { $ this -> getLogger ( ) -> log ( $ message , $ priority , $ extras ) ; } return $ this ; }
Alias for log on logger
15,532
public static function generatePluginsManifest ( array $ packages , string $ outputPath , string $ vendorDir = null ) { $ plugins = [ ] ; foreach ( $ packages as $ package ) { if ( empty ( $ package [ 'extra' ] [ 'jinitialize-plugin' ] ) ) continue ; if ( ! is_null ( $ vendorDir ) ) { $ path = $ vendorDir . '/' . $ pac...
Separate mehtod for testing puroposes
15,533
public function setValue ( $ value ) { switch ( true ) { case ( $ this instanceof Select ) : if ( ! is_array ( $ value ) ) { $ value = ( array ) $ value ; } $ this -> value = $ value ; break ; case ( $ this instanceof Textarea ) : $ this -> inner = $ value ; break ; default : $ this -> attribute [ 'value' ] = $ value ;...
Sets value attribute .
15,534
protected function getProfileIdByTrackingId ( & $ analytics , $ tracking_id ) { $ accounts = $ analytics -> management_accounts -> listManagementAccounts ( ) ; foreach ( $ accounts -> getItems ( ) as $ item ) { $ account_id = $ item -> getId ( ) ; if ( $ account_id != $ tracking_id ) continue ; $ properties = $ analyti...
41534519 - > 73241329
15,535
protected function matchRoute ( $ pathinfo , $ name , BaseRoute $ route ) { $ compiledRoute = $ route -> compile ( ) ; if ( '' !== $ compiledRoute -> getStaticPrefix ( ) && 0 !== strpos ( $ pathinfo , $ compiledRoute -> getStaticPrefix ( ) ) ) { return null ; } if ( ! preg_match ( $ compiledRoute -> getRegex ( ) , $ pa...
Tries to match a URL with an individual route .
15,536
protected function _transition ( StateAwareInterface $ subject , $ transition ) { $ stateMachine = $ this -> _getStateMachineForTransition ( $ subject , $ transition ) ; if ( $ stateMachine === null ) { throw $ this -> _throwTransitionerException ( $ this -> __ ( 'State machine is null' ) ) ; } $ nTransition = $ this -...
Applies a transition to a subject via a state machine .
15,537
public function isFluid ( $ fluid = null ) { if ( isset ( $ fluid ) ) { $ this -> fluid = ( bool ) $ fluid ; return $ this ; } else { return $ this -> fluid ; } }
Sets or gets fluid container flag .
15,538
public function isCollapsible ( $ collapsible = null ) { if ( isset ( $ collapsible ) ) { $ this -> collapsible = ( bool ) $ collapsible ; return $ this ; } else { return $ this -> collapsible ; } }
Sets or gets collapsible flag .
15,539
private function buildMenuItems ( array $ items ) { $ html = '' ; foreach ( $ items as $ item ) { if ( $ this -> multilevel && $ item -> hasChilds ( ) ) { $ html .= ' <li class="navbar-parent"> <a href="' . $ item -> getUrl ( ) . '">' . $ item -> getText ( ) . '</a> <ul>' ; $ html .= $ this -> buildMenuItems...
Builds nav bar elements
15,540
public function addHeader ( $ header , $ type = - 1 ) { if ( $ header instanceof Header ) $ this -> other_headers [ ] = $ header ; else $ this -> addAndCreateHeader ( $ header , $ type ) ; }
Allows you to add a header to the we bpage
15,541
public function display ( ) { $ this -> eventM -> sendEvent ( 'Didplay_Prepare@OWeb\manage\Headers' ) ; echo "\n<!--OWEB displays all CSS includes ; foreach ( $ this -> css_headers as $ id => $ h ) { echo $ h -> getCode ( $ id ) ; } echo "\n<!--OWEB displays all JS includes and codes ; foreach ( $ this -> js_headers as...
Display the Headers that has been added .
15,542
public function toString ( ) { $ s = "\n<!--OWEB displays all CSS includes ; foreach ( $ this -> css_headers as $ id => $ h ) { $ s .= $ h -> getCode ( $ id ) ; } $ s .= "\n<!--OWEB displays all JS includes and codes ; foreach ( $ this -> js_headers as $ id => $ h ) { $ s .= $ h -> getCode ( $ id ) ; } $ s .= "\n<!--OW...
Returns the string that the display function would display .
15,543
public function listJsonAction ( ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ jsonList = $ this -> get ( 'json_list' ) ; $ jsonList -> setRepository ( $ em -> getRepository ( 'EcommerceBundle:Invoice' ) ) ; $ response = $ jsonList -> get ( ) ; return new JsonResponse ( $ response ) ; }
Returns a list of Invoice entities in JSON format .
15,544
public function showAction ( Request $ request , $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ invoice = $ em -> getRepository ( 'EcommerceBundle:Invoice' ) -> find ( $ id ) ; if ( ! $ invoice ) { throw $ this -> createNotFoundException ( 'Unable to find Invoice entity.' ) ; } if ( ! $ invoice || fals...
Finds and displays an Invoice entity .
15,545
public function getField ( ) { $ value = $ this -> name ; if ( null != $ this -> field ) { $ value = $ this -> field ; } return $ value ; }
Gets the field name
15,546
public function setAliases ( array $ aliases ) { foreach ( $ aliases as $ name => $ alias ) { if ( ! ( $ module = $ this -> getModule ( $ name ) ) ) { $ module = $ this -> addModule ( $ name ) ; } $ module -> setAlias ( $ alias ) ; } return $ this ; }
Sets aliases for modules
15,547
public function addModule ( $ module ) { if ( ! ( $ module instanceof ModuleInterface ) ) { $ module = new Module ( $ module ) ; } return ( $ this -> modules [ $ module -> getName ( ) ] = $ module ) ; }
Adds new module into configuration
15,548
public function setHeader ( ) { $ args = func_get_args ( ) ; if ( is_array ( $ args [ 0 ] ) ) { foreach ( $ args [ 0 ] as $ key => $ value ) $ this -> headers [ 'headers' ] [ $ key ] = $ value ; } else { $ this -> headers [ 'headers' ] [ $ args [ 0 ] ] = $ args [ 1 ] ; } return $ this ; }
Add an additional header to the request Can also use the cleaner syntax of
15,549
public function setMime ( $ mime ) { if ( ! empty ( $ mime ) ) { $ this -> setContentType ( Mime :: getFullMime ( $ mime ) ) ; } return $ this ; }
Helper function to set the Content - Type and Expected as same in one swoop
15,550
public function getHandle ( ) { $ ownerClass = get_class ( $ this -> owner ) ; $ ownerTable = $ ownerClass :: tableName ( ) ; if ( ! isset ( self :: $ _handle [ $ ownerTable ] ) ) { self :: $ _handle [ $ ownerTable ] = [ ] ; $ ownerClass = get_class ( $ this -> owner ) ; $ schema = $ ownerClass :: getTableSchema ( ) ; ...
Get handle .
15,551
private function loadModelRules ( ) { foreach ( $ this -> rules [ 'modelRules' ] as $ modelClass => $ modelPolicy ) { $ resourceId = call_user_func_array ( $ this -> config [ 'modelResourceGenerator' ] , [ $ modelClass ] ) ; $ this -> acl -> addResource ( new Resource ( $ resourceId ) ) ; $ modelAccessPolicy = [ ] ; if...
Load model rules
15,552
private function loadRouteRules ( ) { foreach ( $ this -> rules [ 'routeRules' ] as $ routeAlias => $ routeRuleSets ) { $ resourceId = call_user_func_array ( $ this -> config [ 'routeResourceGenerator' ] , [ $ routeAlias ] ) ; $ this -> acl -> addResource ( new Resource ( $ resourceId ) ) ; foreach ( $ routeRuleSets as...
Load route rules
15,553
public static function singularise ( $ word ) { foreach ( static :: $ singularRules as $ rule => $ replacement ) { if ( preg_match ( $ rule , $ word ) ) { return preg_replace ( $ rule , $ replacement , $ word ) ; } } return $ word ; }
Converts the word to singular form .
15,554
public static function pluralise ( $ word ) { foreach ( static :: $ pluralRules as $ rule => $ replacement ) { if ( preg_match ( $ rule , $ word ) ) { return preg_replace ( $ rule , $ replacement , $ word ) ; } } return $ word ; }
Converts the word to plural form .
15,555
protected function _setStateAware ( $ stateAware ) { if ( $ stateAware !== null && ! ( $ stateAware instanceof StateAwareInterface ) ) { throw $ this -> _createInvalidArgumentException ( $ this -> __ ( 'Argument is not a state aware object' ) , null , null , $ stateAware ) ; } $ this -> stateAware = $ stateAware ; }
Sets the state - aware subject for with this instance .
15,556
protected function get ( $ key ) { if ( ! array_key_exists ( $ key , $ this -> source ) ) { if ( $ this -> errProp ) { throw new FieldNotExist ( $ key , $ this ) ; } return null ; } return $ this -> source [ $ key ] ; }
Returns an item from the source
15,557
protected function set ( $ key , $ value ) { if ( $ this -> readonly ) { throw new ContainerReadOnly ( $ this ) ; } if ( $ this -> fixed && ( ! array_key_exists ( $ key , $ this -> source ) ) ) { throw new FieldNotExist ( $ key , $ this ) ; } $ this -> source [ $ key ] = $ value ; }
Sets an item value
15,558
protected function remove ( $ key ) { if ( $ this -> readonly ) { throw new ContainerReadOnly ( $ this ) ; } if ( $ this -> errProp ) { if ( ! array_key_exists ( $ key , $ this -> source ) ) { throw new FieldNotExist ( $ key , $ this ) ; } } if ( $ this -> fixed ) { throw new FieldNotExist ( $ key , $ this ) ; } unset ...
Removes an item from the source array
15,559
protected function getEncapsulationType ( & $ variable , & $ priority , & $ static ) { $ static = NULL ; if ( preg_match ( '/^((?<type>public|protected|private)(?<access>\sstatic)*\:)/' , $ variable , $ match ) ) { $ priority = $ match [ 'type' ] ; $ static = $ match [ 'access' ] ?? $ static ; $ variable = str_ireplace...
Protected get encapsulation type
15,560
public function vlansMapped ( $ instanceID = false ) { $ vlansMapped = [ ] ; $ instances1k2k = $ this -> getSNMP ( ) -> walk1d ( self :: OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_1K2K ) ; $ instances3k4k = $ this -> getSNMP ( ) -> walk1d ( self :: OID_STP_X_SMST_INSTANCE_TABLE_VLANS_MAPPED_3K4K ) ; if ( $ instanceID )...
Return array of MST instances containing an array of mapped VLANs
15,561
public function vlansMappedAsRanges ( $ instanceID = false ) { $ vlansMapped = $ this -> vlansMapped ( $ instanceID ) ; if ( $ instanceID ) $ vlansMapped [ $ instanceID ] = $ vlansMapped ; $ ranges = [ ] ; foreach ( $ vlansMapped as $ id => $ mapped ) { $ start = false ; $ inc = false ; foreach ( $ mapped as $ vid => $...
Return array of MST instances containing an array of mapped VLAN ranges
15,562
public function instances ( $ name = null ) { if ( $ name === null ) $ name = $ this -> getSNMP ( ) -> useCisco_MST ( ) -> regionName ( ) . '.' ; $ hops = $ this -> remainingHopCount ( ) ; $ instances = [ ] ; foreach ( $ hops as $ i => $ h ) if ( $ h != - 1 ) $ instances [ $ i ] = "{$name}{$i}" ; return $ instances ; }
Returns an array of running MST instances .
15,563
public static function throwServiceExceptionIfDetected ( $ e ) { $ response = $ e -> getResponse ( ) ; if ( ! $ response ) { require_once ( 'Zend/Gdata/App/IOException.php' ) ; throw new Zend_Gdata_App_IOException ( 'No HTTP response received (possible connection failure)' ) ; } try { require_once 'Zend/Gdata/Gapps/Ser...
Convert an exception to an ServiceException if an AppsForYourDomain XML document is contained within the original exception s HTTP response . If conversion fails throw the original error .
15,564
public function get ( $ uri , $ extraHeaders = array ( ) ) { try { return parent :: get ( $ uri , $ extraHeaders ) ; } catch ( Zend_Gdata_App_HttpException $ e ) { self :: throwServiceExceptionIfDetected ( $ e ) ; } }
GET a URI using client object . This method overrides the default behavior of Zend_Gdata_App providing support for Zend_Gdata_Gapps_ServiceException .
15,565
public function post ( $ data , $ uri = null , $ remainingRedirects = null , $ contentType = null , $ extraHeaders = null ) { try { return parent :: post ( $ data , $ uri , $ remainingRedirects , $ contentType , $ extraHeaders ) ; } catch ( Zend_Gdata_App_HttpException $ e ) { self :: throwServiceExceptionIfDetected ( ...
POST data with client object . This method overrides the default behavior of Zend_Gdata_App providing support for Zend_Gdata_Gapps_ServiceException .
15,566
public function delete ( $ data , $ remainingRedirects = null ) { try { return parent :: delete ( $ data , $ remainingRedirects ) ; } catch ( Zend_Gdata_App_HttpException $ e ) { self :: throwServiceExceptionIfDetected ( $ e ) ; } }
DELETE entry with client object This method overrides the default behavior of Zend_Gdata_App providing support for Zend_Gdata_Gapps_ServiceException .
15,567
public function getUserFeed ( $ location = null ) { if ( $ location === null ) { $ uri = $ this -> getBaseUrl ( ) . self :: APPS_USER_PATH ; } else if ( $ location instanceof Zend_Gdata_Query ) { $ uri = $ location -> getQueryUrl ( ) ; } else { $ uri = $ location ; } return parent :: getFeed ( $ uri , 'Zend_Gdata_Gapps...
Retrieve a UserFeed containing multiple UserEntry objects .
15,568
public function getNicknameFeed ( $ location = null ) { if ( $ location === null ) { $ uri = $ this -> getBaseUrl ( ) . self :: APPS_NICKNAME_PATH ; } else if ( $ location instanceof Zend_Gdata_Query ) { $ uri = $ location -> getQueryUrl ( ) ; } else { $ uri = $ location ; } return parent :: getFeed ( $ uri , 'Zend_Gda...
Retreive NicknameFeed object containing multiple NicknameEntry objects .
15,569
public function getGroupFeed ( $ location = null ) { if ( $ location === null ) { $ uri = self :: APPS_BASE_FEED_URI . self :: APPS_GROUP_PATH . '/' ; $ uri .= $ this -> getDomain ( ) ; } else if ( $ location instanceof Zend_Gdata_Query ) { $ uri = $ location -> getQueryUrl ( ) ; } else { $ uri = $ location ; } return ...
Retreive GroupFeed object containing multiple GroupEntry objects .
15,570
public function getMemberFeed ( $ location = null ) { if ( $ location === null ) { require_once 'Zend/Gdata/App/InvalidArgumentException.php' ; throw new Zend_Gdata_App_InvalidArgumentException ( 'Location must not be null' ) ; } else if ( $ location instanceof Zend_Gdata_Query ) { $ uri = $ location -> getQueryUrl ( )...
Retreive MemberFeed object containing multiple MemberEntry objects .
15,571
public function insertUser ( $ user , $ uri = null ) { if ( $ uri === null ) { $ uri = $ this -> getBaseUrl ( ) . self :: APPS_USER_PATH ; } $ newEntry = $ this -> insertEntry ( $ user , $ uri , 'Zend_Gdata_Gapps_UserEntry' ) ; return $ newEntry ; }
Create a new user from a UserEntry .
15,572
public function insertNickname ( $ nickname , $ uri = null ) { if ( $ uri === null ) { $ uri = $ this -> getBaseUrl ( ) . self :: APPS_NICKNAME_PATH ; } $ newEntry = $ this -> insertEntry ( $ nickname , $ uri , 'Zend_Gdata_Gapps_NicknameEntry' ) ; return $ newEntry ; }
Create a new nickname from a NicknameEntry .
15,573
public function insertGroup ( $ group , $ uri = null ) { if ( $ uri === null ) { $ uri = self :: APPS_BASE_FEED_URI . self :: APPS_GROUP_PATH . '/' ; $ uri .= $ this -> getDomain ( ) ; } $ newEntry = $ this -> insertEntry ( $ group , $ uri , 'Zend_Gdata_Gapps_GroupEntry' ) ; return $ newEntry ; }
Create a new group from a GroupEntry .
15,574
public function insertMember ( $ member , $ uri = null ) { if ( $ uri === null ) { require_once 'Zend/Gdata/App/InvalidArgumentException.php' ; throw new Zend_Gdata_App_InvalidArgumentException ( 'URI must not be null' ) ; } $ newEntry = $ this -> insertEntry ( $ member , $ uri , 'Zend_Gdata_Gapps_MemberEntry' ) ; retu...
Create a new member from a MemberEntry .
15,575
public function insertOwner ( $ owner , $ uri = null ) { if ( $ uri === null ) { require_once 'Zend/Gdata/App/InvalidArgumentException.php' ; throw new Zend_Gdata_App_InvalidArgumentException ( 'URI must not be null' ) ; } $ newEntry = $ this -> insertEntry ( $ owner , $ uri , 'Zend_Gdata_Gapps_OwnerEntry' ) ; return $...
Create a new group from a OwnerEntry .
15,576
public function insertEmailList ( $ emailList , $ uri = null ) { if ( $ uri === null ) { $ uri = $ this -> getBaseUrl ( ) . self :: APPS_EMAIL_LIST_PATH ; } $ newEntry = $ this -> insertEntry ( $ emailList , $ uri , 'Zend_Gdata_Gapps_EmailListEntry' ) ; return $ newEntry ; }
Create a new email list from an EmailListEntry .
15,577
public function insertEmailListRecipient ( $ recipient , $ uri = null ) { if ( $ uri === null ) { require_once 'Zend/Gdata/App/InvalidArgumentException.php' ; throw new Zend_Gdata_App_InvalidArgumentException ( 'URI must not be null' ) ; } elseif ( $ uri instanceof Zend_Gdata_Gapps_EmailListEntry ) { $ uri = $ uri -> g...
Create a new email list recipient from an EmailListRecipientEntry .
15,578
public function createUser ( $ username , $ givenName , $ familyName , $ password , $ passwordHashFunction = null , $ quotaLimitInMB = null ) { $ user = $ this -> newUserEntry ( ) ; $ user -> login = $ this -> newLogin ( ) ; $ user -> login -> username = $ username ; $ user -> login -> password = $ password ; $ user ->...
Create a new user entry and send it to the Google Apps servers .
15,579
public function retrieveUser ( $ username ) { $ query = $ this -> newUserQuery ( $ username ) ; try { $ user = $ this -> getUserEntry ( $ query ) ; } catch ( Zend_Gdata_Gapps_ServiceException $ e ) { if ( $ e -> hasError ( Zend_Gdata_Gapps_Error :: ENTITY_DOES_NOT_EXIST ) ) { $ user = null ; } else { throw $ e ; } } re...
Retrieve a user based on their username .
15,580
public function retrievePageOfUsers ( $ startUsername = null ) { $ query = $ this -> newUserQuery ( ) ; $ query -> setStartUsername ( $ startUsername ) ; return $ this -> getUserFeed ( $ query ) ; }
Retrieve a page of users in alphabetical order starting with the provided username .
15,581
public function updateUser ( $ username , $ userEntry ) { return $ this -> updateEntry ( $ userEntry , $ this -> getBaseUrl ( ) . self :: APPS_USER_PATH . '/' . $ username ) ; }
Overwrite a specified username with the provided UserEntry . The UserEntry does not need to contain an edit link .
15,582
public function suspendUser ( $ username ) { $ user = $ this -> retrieveUser ( $ username ) ; $ user -> login -> suspended = true ; return $ user -> save ( ) ; }
Mark a given user as suspended .
15,583
public function restoreUser ( $ username ) { $ user = $ this -> retrieveUser ( $ username ) ; $ user -> login -> suspended = false ; return $ user -> save ( ) ; }
Mark a given user as not suspended .
15,584
public function createNickname ( $ username , $ nickname ) { $ entry = $ this -> newNicknameEntry ( ) ; $ nickname = $ this -> newNickname ( $ nickname ) ; $ login = $ this -> newLogin ( $ username ) ; $ entry -> nickname = $ nickname ; $ entry -> login = $ login ; return $ this -> insertNickname ( $ entry ) ; }
Create a nickname for a given user .
15,585
public function retrieveNickname ( $ nickname ) { $ query = $ this -> newNicknameQuery ( ) ; $ query -> setNickname ( $ nickname ) ; try { $ nickname = $ this -> getNicknameEntry ( $ query ) ; } catch ( Zend_Gdata_Gapps_ServiceException $ e ) { if ( $ e -> hasError ( Zend_Gdata_Gapps_Error :: ENTITY_DOES_NOT_EXIST ) ) ...
Retrieve the entry for a specified nickname .
15,586
public function retrieveNicknames ( $ username ) { $ query = $ this -> newNicknameQuery ( ) ; $ query -> setUsername ( $ username ) ; $ nicknameFeed = $ this -> retrieveAllEntriesForFeed ( $ this -> getNicknameFeed ( $ query ) ) ; return $ nicknameFeed ; }
Retrieve all nicknames associated with a specific username .
15,587
public function retrievePageOfNicknames ( $ startNickname = null ) { $ query = $ this -> newNicknameQuery ( ) ; $ query -> setStartNickname ( $ startNickname ) ; return $ this -> getNicknameFeed ( $ query ) ; }
Retrieve a page of nicknames in alphabetical order starting with the provided nickname .
15,588
public function retrieveGroup ( $ groupId ) { $ query = $ this -> newGroupQuery ( $ groupId ) ; try { $ group = $ this -> getGroupEntry ( $ query ) ; } catch ( Zend_Gdata_Gapps_ServiceException $ e ) { if ( $ e -> hasError ( Zend_Gdata_Gapps_Error :: ENTITY_DOES_NOT_EXIST ) ) { $ group = null ; } else { throw $ e ; } }...
Retrieves a group based on group id
15,589
public function isMember ( $ memberId , $ groupId ) { $ uri = self :: APPS_BASE_FEED_URI . self :: APPS_GROUP_PATH . '/' ; $ uri .= $ this -> getDomain ( ) . '/' . $ groupId . '/member/' . $ memberId ; try { $ results = $ this -> get ( $ uri ) ; } catch ( Exception $ e ) { $ results = false ; } if ( $ results ) { retur...
Check to see if a member id or group id is a member of group
15,590
public function addMemberToGroup ( $ recipientAddress , $ groupId ) { $ member = $ this -> newMemberEntry ( ) ; $ properties [ ] = $ this -> newProperty ( ) ; $ properties [ 0 ] -> name = 'memberId' ; $ properties [ 0 ] -> value = $ recipientAddress ; $ member -> property = $ properties ; $ uri = self :: APPS_BASE_FEED...
Add an email address to a group as a member
15,591
public function removeMemberFromGroup ( $ memberId , $ groupId ) { $ uri = self :: APPS_BASE_FEED_URI . self :: APPS_GROUP_PATH . '/' ; $ uri .= $ this -> getDomain ( ) . '/' . $ groupId . '/member/' . $ memberId ; return $ this -> delete ( $ uri ) ; }
Remove a member id from a group
15,592
public function addOwnerToGroup ( $ email , $ groupId ) { $ owner = $ this -> newOwnerEntry ( ) ; $ properties [ ] = $ this -> newProperty ( ) ; $ properties [ 0 ] -> name = 'email' ; $ properties [ 0 ] -> value = $ email ; $ owner -> property = $ properties ; $ uri = self :: APPS_BASE_FEED_URI . self :: APPS_GROUP_PAT...
Add an email as an owner of a group
15,593
public function retrieveGroupOwners ( $ groupId ) { $ uri = self :: APPS_BASE_FEED_URI . self :: APPS_GROUP_PATH . '/' ; $ uri .= $ this -> getDomain ( ) . '/' . $ groupId . '/owner' ; return $ this -> getOwnerFeed ( $ uri ) ; }
Retrieves all the owners of a group
15,594
public function isOwner ( $ email , $ groupId ) { $ uri = self :: APPS_BASE_FEED_URI . self :: APPS_GROUP_PATH . '/' ; $ uri .= $ this -> getDomain ( ) . '/' . $ groupId . '/owner/' . $ email ; try { $ results = $ this -> get ( $ uri ) ; } catch ( Exception $ e ) { $ results = false ; } if ( $ results ) { return TRUE ;...
Checks to see if an email is an owner of a group
15,595
public function removeOwnerFromGroup ( $ email , $ groupId ) { $ uri = self :: APPS_BASE_FEED_URI . self :: APPS_GROUP_PATH . '/' ; $ uri .= $ this -> getDomain ( ) . '/' . $ groupId . '/owner/' . $ email ; return $ this -> delete ( $ uri ) ; }
Remove email as an owner of a group
15,596
public function updateGroup ( $ groupId , $ groupName = null , $ description = null , $ emailPermission = null ) { $ i = 0 ; $ group = $ this -> newGroupEntry ( ) ; $ properties [ $ i ] = $ this -> newProperty ( ) ; $ properties [ $ i ] -> name = 'groupId' ; $ properties [ $ i ] -> value = $ groupId ; $ i ++ ; if ( $ g...
Update group properties with new values . any property not defined will not be updated
15,597
public function retrieveGroups ( $ memberId , $ directOnly = null ) { $ query = $ this -> newGroupQuery ( ) ; $ query -> setMember ( $ memberId ) ; if ( $ directOnly != null ) { $ query -> setDirectOnly ( $ directOnly ) ; } return $ this -> getGroupFeed ( $ query ) ; }
Retrieve all of the groups that a user is a member of
15,598
public function retrievePageOfGroups ( $ startGroup = null ) { $ query = $ this -> newGroupQuery ( ) ; $ query -> setStartGroupId ( $ startGroup ) ; return $ this -> getGroupFeed ( $ query ) ; }
Retrieve a page of groups in alphabetical order starting with the provided group .
15,599
public function retrievePageOfMembers ( $ groupId , $ startMember = null ) { $ query = $ this -> newMemberQuery ( $ groupId ) ; $ query -> setStartMemberId ( $ startMember ) ; return $ this -> getMemberFeed ( $ query ) ; }
Gets page of Members