idx
int64 0
60.3k
| question
stringlengths 101
6.21k
| target
stringlengths 7
803
|
|---|---|---|
53,200
|
public function all ( array $ params = array ( ) ) { $ response = $ this -> request ( '/admin/webhooks.json' , 'GET' , $ params ) ; return $ this -> createCollection ( Webhook :: class , $ response [ 'webhooks' ] ) ; }
|
Receive a list of all webhooks
|
53,201
|
public function get ( $ webhookId , array $ fields = array ( ) ) { $ params = array ( ) ; if ( ! empty ( $ fields ) ) { $ params [ 'fields' ] = implode ( ',' , $ fields ) ; } $ response = $ this -> request ( '/admin/webhooks/' . $ webhookId . '.json' , 'GET' , $ params ) ; return $ this -> createObject ( Webhook :: class , $ response [ 'webhook' ] ) ; }
|
Receive a single webhook
|
53,202
|
public function create ( Webhook & $ webhook ) { $ data = $ webhook -> exportData ( ) ; $ response = $ this -> request ( '/admin/webhooks.json' , 'POST' , array ( 'webhook' => $ data ) ) ; $ webhook -> setData ( $ response [ 'webhook' ] ) ; }
|
Create a new webhook
|
53,203
|
public function update ( Webhook $ webhook ) { $ data = $ webhook -> exportData ( ) ; $ response = $ this -> request ( '/admin/webhooks/' . $ webhook -> id . '.json' , 'PUT' , array ( 'webhook' => $ data ) ) ; $ webhook -> setData ( $ response [ 'webhook' ] ) ; }
|
Modify an existing webhook
|
53,204
|
public function createDocument ( array $ properties , StreamInterface $ contentStream , VersioningState $ versioningState , array $ policies = [ ] , array $ addAces = [ ] , array $ removeAces = [ ] , OperationContextInterface $ context = null ) { $ newObjectId = $ this -> getSession ( ) -> createDocument ( $ properties , $ this , $ contentStream , $ versioningState , $ policies , $ addAces , $ removeAces ) ; $ document = $ this -> getNewlyCreatedObject ( $ newObjectId , $ context ) ; if ( $ document === null ) { return null ; } elseif ( ! $ document instanceof DocumentInterface ) { throw new CmisRuntimeException ( 'Newly created object is not a document! New id: ' . $ document -> getId ( ) ) ; } return $ document ; }
|
Creates a new document in this folder .
|
53,205
|
public function createDocumentFromSource ( ObjectIdInterface $ source , array $ properties , VersioningState $ versioningState , array $ policies = [ ] , array $ addAces = [ ] , array $ removeAces = [ ] , OperationContextInterface $ context = null ) { $ newObjectId = $ this -> getSession ( ) -> createDocumentFromSource ( $ source , $ properties , $ this , $ versioningState , $ policies , $ addAces , $ removeAces ) ; $ document = $ this -> getNewlyCreatedObject ( $ newObjectId , $ context ) ; if ( $ document === null ) { return null ; } elseif ( ! $ document instanceof DocumentInterface ) { throw new CmisRuntimeException ( 'Newly created object is not a document! New id: ' . $ document -> getId ( ) ) ; } return $ document ; }
|
Creates a new document from a source document in this folder .
|
53,206
|
public function createFolder ( array $ properties , array $ policies = [ ] , array $ addAces = [ ] , array $ removeAces = [ ] , OperationContextInterface $ context = null ) { $ newObjectId = $ this -> getSession ( ) -> createFolder ( $ properties , $ this , $ policies , $ addAces , $ removeAces ) ; $ folder = $ this -> getNewlyCreatedObject ( $ newObjectId , $ context ) ; if ( $ folder === null ) { return null ; } elseif ( ! $ folder instanceof FolderInterface ) { throw new CmisRuntimeException ( 'Newly created object is not a folder! New id: ' . $ folder -> getId ( ) ) ; } return $ folder ; }
|
Creates a new subfolder in this folder .
|
53,207
|
public function createItem ( array $ properties , array $ policies = [ ] , array $ addAces = [ ] , array $ removeAces = [ ] , OperationContextInterface $ context = null ) { $ newObjectId = $ this -> getSession ( ) -> createItem ( $ properties , $ this , $ policies , $ addAces , $ removeAces ) ; $ item = $ this -> getNewlyCreatedObject ( $ newObjectId , $ context ) ; if ( $ item === null ) { return null ; } elseif ( ! $ item instanceof ItemInterface ) { throw new CmisRuntimeException ( 'Newly created object is not a item! New id: ' . $ item -> getId ( ) ) ; } return $ item ; }
|
Creates a new item in this folder .
|
53,208
|
public function createPolicy ( array $ properties , array $ policies = [ ] , array $ addAces = [ ] , array $ removeAces = [ ] , OperationContextInterface $ context = null ) { $ newObjectId = $ this -> getSession ( ) -> createPolicy ( $ properties , $ this , $ policies , $ addAces , $ removeAces ) ; $ policy = $ this -> getNewlyCreatedObject ( $ newObjectId , $ context ) ; if ( $ policy === null ) { return null ; } elseif ( ! $ policy instanceof PolicyInterface ) { throw new CmisRuntimeException ( 'Newly created object is not a policy! New id: ' . $ policy -> getId ( ) ) ; } return $ policy ; }
|
Creates a new policy in this folder .
|
53,209
|
public function deleteTree ( $ allVersions , UnfileObject $ unfile , $ continueOnFailure = true ) { $ failed = $ this -> getBinding ( ) -> getObjectService ( ) -> deleteTree ( $ this -> getRepositoryId ( ) , $ this -> getId ( ) , $ allVersions , $ unfile , $ continueOnFailure ) ; if ( count ( $ failed -> getIds ( ) ) === 0 ) { $ this -> getSession ( ) -> removeObjectFromCache ( $ this ) ; } return $ failed ; }
|
Deletes this folder and all subfolders .
|
53,210
|
public function getCheckedOutDocs ( OperationContextInterface $ context = null ) { $ context = $ this -> ensureContext ( $ context ) ; $ checkedOutDocs = $ this -> getBinding ( ) -> getNavigationService ( ) -> getCheckedOutDocs ( $ this -> getRepositoryId ( ) , $ this -> getId ( ) , $ context -> getQueryFilterString ( ) , $ context -> getOrderBy ( ) , $ context -> isIncludeAllowableActions ( ) , $ context -> getIncludeRelationships ( ) , $ context -> getRenditionFilterString ( ) ) ; $ result = [ ] ; $ objectFactory = $ this -> getObjectFactory ( ) ; foreach ( $ checkedOutDocs -> getObjects ( ) as $ objectData ) { $ document = $ objectFactory -> convertObject ( $ objectData , $ context ) ; if ( ! ( $ document instanceof DocumentInterface ) ) { continue ; } $ result [ ] = $ document ; } return $ result ; }
|
Returns all checked out documents in this folder using the given OperationContext .
|
53,211
|
public function getChildren ( OperationContextInterface $ context = null ) { $ context = $ this -> ensureContext ( $ context ) ; $ children = $ this -> getBinding ( ) -> getNavigationService ( ) -> getChildren ( $ this -> getRepositoryId ( ) , $ this -> getId ( ) , $ context -> getQueryFilterString ( ) , $ context -> getOrderBy ( ) , $ context -> isIncludeAllowableActions ( ) , $ context -> getIncludeRelationships ( ) , $ context -> getRenditionFilterString ( ) , $ context -> isIncludePathSegments ( ) ) ; $ result = [ ] ; $ objectFactory = $ this -> getObjectFactory ( ) ; foreach ( $ children -> getObjects ( ) as $ objectData ) { if ( $ objectData -> getObject ( ) !== null ) { $ result [ ] = $ objectFactory -> convertObject ( $ objectData -> getObject ( ) , $ context ) ; } } return $ result ; }
|
Returns the children of this folder using the given OperationContext .
|
53,212
|
public function getFolderParent ( ) { if ( $ this -> isRootFolder ( ) ) { return null ; } $ parents = $ this -> getParents ( $ this -> getSession ( ) -> getDefaultContext ( ) ) ; $ parent = reset ( $ parents ) ; if ( ! $ parent instanceof FolderInterface ) { return null ; } return $ parent ; }
|
Gets the parent folder object .
|
53,213
|
public function getFolderTree ( $ depth , OperationContextInterface $ context = null ) { $ context = $ this -> ensureContext ( $ context ) ; $ containerList = $ this -> getBinding ( ) -> getNavigationService ( ) -> getFolderTree ( $ this -> getRepositoryId ( ) , $ this -> getId ( ) , ( int ) $ depth , $ context -> getQueryFilterString ( ) , $ context -> isIncludeAllowableActions ( ) , $ context -> getIncludeRelationships ( ) , $ context -> getRenditionFilterString ( ) , $ context -> isIncludePathSegments ( ) ) ; return $ this -> convertBindingContainer ( $ containerList , $ context ) ; }
|
Gets the folder tree starting with this folder using the given OperationContext .
|
53,214
|
public function getPath ( ) { $ path = $ this -> getPropertyValue ( PropertyIds :: PATH ) ; if ( $ path === null ) { $ objectData = $ this -> getBinding ( ) -> getObjectService ( ) -> getObject ( $ this -> getRepositoryId ( ) , $ this -> getId ( ) , $ this -> getPropertyQueryName ( PropertyIds :: PATH ) , false , IncludeRelationships :: cast ( IncludeRelationships :: NONE ) , Constants :: RENDITION_NONE , false , false ) ; if ( $ objectData !== null && $ objectData -> getProperties ( ) !== null && $ objectData -> getProperties ( ) -> getProperties ( ) !== null ) { $ objectProperties = $ objectData -> getProperties ( ) -> getProperties ( ) ; if ( isset ( $ objectProperties [ PropertyIds :: PATH ] ) && $ objectProperties [ PropertyIds :: PATH ] instanceof PropertyString ) { $ path = $ objectProperties [ PropertyIds :: PATH ] -> getFirstValue ( ) ; } } } if ( $ path === null ) { throw new CmisRuntimeException ( 'Repository didn\'t return ' . PropertyIds :: PATH . '!' ) ; } return $ path ; }
|
Returns the path of the folder .
|
53,215
|
public function all ( array $ params = array ( ) ) { $ data = $ this -> request ( '/admin/application_credits.json' , 'GET' , $ params ) ; return $ this -> createCollection ( ApplicationCredit :: class , $ data [ 'application_credits' ] ) ; }
|
Retrieve all application credits
|
53,216
|
public function get ( $ applicationCreditId , array $ fields = array ( ) ) { $ params = array ( ) ; if ( ! empty ( $ fields ) ) { $ params [ 'fields' ] = implode ( ',' , $ fields ) ; } $ endpoint = '/admin/application_credits/' . $ applicationCreditId . '.json' ; $ data = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createObject ( ApplicationCredit :: class , $ data [ 'application_credit' ] ) ; }
|
Receive a single ApplicationCredit
|
53,217
|
public function create ( ApplicationCredit & $ applicationCredit ) { $ data = $ applicationCredit -> exportData ( ) ; $ endpoint = '/admin/application_credits.json' ; $ response = $ this -> request ( $ endpoint , 'POST' , array ( 'application_charge' => $ data ) ) ; $ applicationCredit -> setData ( $ response [ 'application_credit' ] ) ; }
|
Create an application credit
|
53,218
|
public function setList ( array $ list ) { foreach ( $ list as $ item ) { $ this -> checkType ( TypeDefinitionInterface :: class , $ item ) ; } $ this -> list = $ list ; }
|
Set a list of type definitions
|
53,219
|
public function all ( $ orderId , $ fulfillmentId ) { $ endpoint = '/admin/orders/' . $ orderId . '/fulfillments/' . $ fulfillmentId . '/events.json' ; $ response = $ this -> request ( $ endpoint , 'GET' ) ; return $ this -> createCollection ( FulfillmentEvent :: class , $ response [ 'fulfillment_events' ] ) ; }
|
Receive a list of all fulfillmen events
|
53,220
|
public function get ( $ orderId , $ fulfillmentId , $ fulfillmentEventId ) { $ endpoint = '/admin/orders/' . $ orderId . '/fulfillments/' . $ fulfillmentId . '/events/' . $ fulfillmentEventId . '.json' ; $ response = $ this -> request ( $ endpoint ) ; return $ this -> createObject ( FulfillmentEvent :: class , $ response [ 'fulfillment_event' ] ) ; }
|
Get a specific fulfillment event
|
53,221
|
public function create ( $ orderId , $ fulfillmentId , FulfillmentEvent & $ fulfillmentEvent ) { $ data = $ fulfillmentEvent -> exportData ( ) ; $ endpoint = '/admin/orders/' . $ orderId . '/fulfillments/' . $ fulfillmentId . '/events.json' ; $ response = $ this -> request ( $ endpoint , 'POST' , array ( 'fulfillment_event' => $ data ) ) ; $ fulfillmentEvent -> setData ( $ response [ 'fulfillment_event' ] ) ; }
|
Create a fulfillment event
|
53,222
|
public function delete ( $ orderId , $ fulfillmentId , FulfillmentEvent $ fulfillmentEvent ) { $ endpoint = '/admin/orders/' . $ orderId . '/fulfillments/' . $ fulfillmentId . '/events/' . $ fulfillmentEvent -> id . '.json' ; $ response = $ this -> request ( $ endpoint , 'DELETE' ) ; return ; }
|
Delete a fufillment events
|
53,223
|
public function get ( $ orderId , array $ params = array ( ) ) { $ endpoint = '/admin/orders/' . $ orderId . '.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createObject ( Order :: class , $ response [ 'order' ] ) ; }
|
Receive a single Order
|
53,224
|
public function close ( Order & $ order ) { $ data = $ order -> exportData ( ) ; $ endpoint = '/admin/orders/' . $ order -> id . '/close.json' ; $ response = $ this -> request ( $ endpoint , 'POST' ) ; $ order -> setData ( $ response [ 'order' ] ) ; }
|
Close an Order
|
53,225
|
protected function generateStatementFromPropertiesAndTypesLists ( array $ selectPropertyIds , array $ fromTypes , $ whereClause , array $ orderByPropertyIds ) { $ statementString = 'SELECT ' . $ this -> generateStatementPropertyList ( $ selectPropertyIds , false ) ; $ primaryTable = array_shift ( $ fromTypes ) ; list ( $ primaryTableQueryName , $ primaryAlias ) = $ this -> getQueryNameAndAliasForType ( $ primaryTable , 'primary' ) ; $ statementString .= ' FROM ' . $ primaryTableQueryName . ' ' . $ primaryAlias ; while ( count ( $ fromTypes ) > 0 ) { $ secondaryTable = array_shift ( $ fromTypes ) ; $ alias = chr ( 97 + count ( $ fromTypes ) ) ; list ( $ secondaryTableQueryName , $ alias ) = $ this -> getQueryNameAndAliasForType ( $ secondaryTable , $ alias ) ; $ statementString .= ' JOIN ' . $ secondaryTableQueryName . ' AS ' . $ alias . ' ON ' . $ primaryAlias . '.cmis:objectId = ' . $ alias . '.cmis:objectId' ; } if ( trim ( ( string ) $ whereClause ) ) { $ statementString .= ' WHERE ' . trim ( $ whereClause ) ; } if ( ! empty ( $ orderByPropertyIds ) ) { $ statementString .= ' ORDER BY ' . $ this -> generateStatementPropertyList ( $ orderByPropertyIds , true ) ; } return trim ( $ statementString ) ; }
|
Generates a statement based on input criteria with the necessary JOINs in place for selecting attributes related to all provided types .
|
53,226
|
protected function getQueryNameAndAliasForType ( $ typeDefinitionMixed , $ autoAlias ) { $ alias = null ; if ( is_array ( $ typeDefinitionMixed ) ) { list ( $ typeDefinitionMixed , $ alias ) = $ typeDefinitionMixed ; } if ( $ typeDefinitionMixed instanceof TypeDefinitionInterface ) { $ queryName = $ typeDefinitionMixed -> getQueryName ( ) ; } elseif ( is_string ( $ typeDefinitionMixed ) && strpos ( $ typeDefinitionMixed , ' ' ) ) { list ( $ typeDefinitionMixed , $ alias ) = explode ( ' ' , $ typeDefinitionMixed , 2 ) ; } try { $ queryName = $ this -> session -> getTypeDefinition ( $ typeDefinitionMixed ) -> getQueryName ( ) ; } catch ( CmisObjectNotFoundException $ error ) { $ queryName = $ typeDefinitionMixed ; } return [ $ queryName , ( $ alias ? $ alias : $ autoAlias ) ] ; }
|
Translates a TypeDefinition or string into a query name for that TypeDefinition . Returns the input string as fallback if the type could not be resolved . Input may contain an alias if so we split and preserve the alias but attempt to translate the type ID part .
|
53,227
|
public function setDateTime ( $ parameterIndex , \ DateTime $ dateTime ) { $ this -> setParameter ( $ parameterIndex , $ dateTime -> format ( Constants :: QUERY_DATETIMEFORMAT ) ) ; }
|
Sets the designated parameter to the given DateTime value .
|
53,228
|
public function setId ( $ parameterIndex , ObjectIdInterface $ id ) { $ this -> setParameter ( $ parameterIndex , $ this -> escape ( $ id -> getId ( ) ) ) ; }
|
Sets the designated parameter to the given object ID .
|
53,229
|
public function setNumber ( $ parameterIndex , $ number ) { if ( ! is_int ( $ number ) ) { throw new CmisInvalidArgumentException ( 'Number must be of type integer!' ) ; } $ this -> setParameter ( $ parameterIndex , $ number ) ; }
|
Sets the designated parameter to the given number .
|
53,230
|
public function setProperty ( $ parameterIndex , PropertyDefinitionInterface $ propertyDefinition ) { $ queryName = $ propertyDefinition -> getQueryName ( ) ; if ( empty ( $ queryName ) ) { throw new CmisInvalidArgumentException ( 'Property has no query name!' ) ; } $ this -> setParameter ( $ parameterIndex , $ this -> escape ( $ queryName ) ) ; }
|
Sets the designated parameter to the query name of the given property .
|
53,231
|
public function setString ( $ parameterIndex , $ string ) { if ( ! is_string ( $ string ) ) { throw new CmisInvalidArgumentException ( 'Parameter string must be of type string!' ) ; } $ this -> setParameter ( $ parameterIndex , $ this -> escape ( $ string ) ) ; }
|
Sets the designated parameter to the given string .
|
53,232
|
public function setStringContains ( $ parameterIndex , $ string ) { if ( ! is_string ( $ string ) ) { throw new CmisInvalidArgumentException ( 'Parameter string must be of type string!' ) ; } $ this -> setParameter ( $ parameterIndex , $ this -> escapeContains ( $ string ) ) ; }
|
Sets the designated parameter to the given string in a CMIS contains statement .
|
53,233
|
public function setType ( $ parameterIndex , ObjectTypeInterface $ type ) { $ this -> setParameter ( $ parameterIndex , $ this -> escape ( $ type -> getQueryName ( ) ) ) ; }
|
Sets the designated parameter to the query name of the given type .
|
53,234
|
protected function setParameter ( $ parameterIndex , $ value ) { if ( ! is_int ( $ parameterIndex ) ) { throw new CmisInvalidArgumentException ( 'Parameter index must be of type integer!' ) ; } $ this -> parametersMap [ $ parameterIndex ] = $ value ; }
|
Sets the designated parameter to the given value
|
53,235
|
public function toQueryString ( ) { $ queryString = '' ; $ inString = false ; $ parameterIndex = 0 ; $ length = strlen ( $ this -> statement ) ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { $ char = $ this -> statement { $ i } ; if ( $ char === '\'' ) { if ( $ inString && $ this -> statement { max ( 0 , $ i - 1 ) } === '\\' ) { $ inString = true ; } else { $ inString = ! $ inString ; } $ queryString .= $ char ; } elseif ( $ char === '?' && ! $ inString ) { $ parameterIndex ++ ; $ queryString .= $ this -> parametersMap [ $ parameterIndex ] ; } else { $ queryString .= $ char ; } } return $ queryString ; }
|
Returns the query statement .
|
53,236
|
public function isAllowed ( $ entry ) { foreach ( $ this -> entries as $ elmt ) { if ( $ elmt -> check ( $ entry ) ) { return $ this -> matchingResponse ; } } return null ; }
|
Whether or not the Entry is allowed by this list
|
53,237
|
public function getMatchingEntries ( ) { if ( $ this -> matchingEntries === null ) { $ this -> matchingEntries = array ( ) ; foreach ( $ this -> entries as $ entry ) { $ this -> matchingEntries = array_merge ( $ this -> matchingEntries , $ entry -> getMatchingEntries ( ) ) ; } } return $ this -> matchingEntries ; }
|
Resolve all entries match the list
|
53,238
|
public function initialize ( SessionInterface $ session , ObjectTypeInterface $ objectType , OperationContextInterface $ context , ObjectDataInterface $ objectData = null ) { if ( count ( $ this -> getMissingBaseProperties ( $ objectType -> getPropertyDefinitions ( ) ) ) !== 0 ) { throw new CmisInvalidArgumentException ( sprintf ( 'Object type must have at least the base property definitions! ' . 'These property definitions are missing: %s' , implode ( ', ' , PropertyIds :: getBasePropertyKeys ( ) ) ) ) ; } ; $ this -> session = $ session ; $ this -> objectType = $ objectType ; $ this -> secondaryTypes = null ; $ this -> creationContext = clone $ context ; $ this -> refreshTimestamp = ( integer ) round ( microtime ( true ) * 1000 ) ; if ( $ objectData !== null ) { $ this -> initializeObjectData ( $ objectData ) ; } }
|
Initialize the CMIS Object
|
53,239
|
private function initializeObjectData ( ObjectDataInterface $ objectData ) { if ( $ objectData -> getProperties ( ) !== null ) { $ this -> initializeObjectDataProperties ( $ objectData -> getProperties ( ) ) ; } if ( $ objectData -> getAllowableActions ( ) !== null ) { $ this -> allowableActions = $ objectData -> getAllowableActions ( ) ; $ this -> extensions [ ( string ) ExtensionLevel :: cast ( ExtensionLevel :: ALLOWABLE_ACTIONS ) ] = $ objectData -> getAllowableActions ( ) -> getExtensions ( ) ; } foreach ( $ objectData -> getRenditions ( ) as $ rendition ) { $ this -> renditions [ ] = $ this -> getObjectFactory ( ) -> convertRendition ( $ this -> getId ( ) , $ rendition ) ; } if ( $ objectData -> getAcl ( ) !== null ) { $ this -> acl = $ objectData -> getAcl ( ) ; $ this -> extensions [ ( string ) ExtensionLevel :: cast ( ExtensionLevel :: ACL ) ] = $ objectData -> getAcl ( ) -> getExtensions ( ) ; } if ( $ objectData -> getPolicyIds ( ) !== null ) { $ this -> initializeObjectDataPolicies ( $ objectData -> getPolicyIds ( ) ) ; } foreach ( $ objectData -> getRelationships ( ) as $ relationshipData ) { $ relationship = $ this -> getObjectFactory ( ) -> convertObject ( $ relationshipData , $ this -> getCreationContext ( ) ) ; if ( $ relationship instanceof RelationshipInterface ) { $ this -> relationships [ ] = $ relationship ; } } $ this -> extensions [ ( string ) ExtensionLevel :: OBJECT ] = $ objectData -> getExtensions ( ) ; }
|
Handle initialization for objectData
|
53,240
|
private function initializeObjectDataProperties ( PropertiesInterface $ properties ) { $ propertyList = $ properties -> getProperties ( ) ; if ( isset ( $ propertyList [ PropertyIds :: SECONDARY_OBJECT_TYPE_IDS ] ) ) { $ this -> secondaryTypes = [ ] ; foreach ( $ propertyList [ PropertyIds :: SECONDARY_OBJECT_TYPE_IDS ] -> getValues ( ) as $ secondaryTypeId ) { $ type = $ this -> getSession ( ) -> getTypeDefinition ( $ secondaryTypeId ) ; if ( $ type instanceof SecondaryTypeInterface ) { $ this -> secondaryTypes [ ] = $ type ; } } } $ this -> properties = $ this -> getObjectFactory ( ) -> convertPropertiesDataToPropertyList ( $ this -> getObjectType ( ) , ( array ) $ this -> getSecondaryTypes ( ) , $ properties ) ; $ this -> extensions [ ( string ) ExtensionLevel :: cast ( ExtensionLevel :: PROPERTIES ) ] = $ properties -> getExtensions ( ) ; }
|
Handle initialization of properties from the object data
|
53,241
|
private function initializeObjectDataPolicies ( PolicyIdListInterface $ policies ) { foreach ( $ policies -> getPolicyIds ( ) as $ policyId ) { $ policy = $ this -> getSession ( ) -> getObject ( $ this -> getSession ( ) -> createObjectId ( $ policyId ) ) ; if ( $ policy instanceof PolicyInterface ) { $ this -> policies [ ] = $ policy ; } } $ this -> extensions [ ( string ) ExtensionLevel :: POLICIES ] = $ policies -> getExtensions ( ) ; }
|
Handle initialization of policies from the object data
|
53,242
|
protected function getMissingBaseProperties ( array $ properties = null ) { $ basePropertyKeys = PropertyIds :: getBasePropertyKeys ( ) ; if ( $ properties === null ) { return $ basePropertyKeys ; } foreach ( $ properties as $ property ) { $ propertyId = $ property -> getId ( ) ; $ basePropertyKey = array_search ( $ propertyId , $ basePropertyKeys ) ; if ( $ basePropertyKey !== false ) { unset ( $ basePropertyKeys [ $ basePropertyKey ] ) ; } } return $ basePropertyKeys ; }
|
Returns a list of missing property keys
|
53,243
|
protected function getPropertyQueryName ( $ propertyId ) { $ propertyDefinition = $ this -> getObjectType ( ) -> getPropertyDefinition ( $ propertyId ) ; if ( $ propertyDefinition === null ) { return null ; } return $ propertyDefinition -> getQueryName ( ) ; }
|
Returns the query name of a property .
|
53,244
|
public function updateProperties ( array $ properties , $ refresh = true ) { if ( empty ( $ properties ) ) { throw new CmisInvalidArgumentException ( 'Properties must not be empty!' ) ; } $ objectId = $ this -> getId ( ) ; $ changeToken = $ this -> getChangeToken ( ) ; $ updatability = [ ] ; $ updatability [ ] = Updatability :: cast ( Updatability :: READWRITE ) ; if ( ( boolean ) $ this -> getPropertyValue ( PropertyIds :: IS_VERSION_SERIES_CHECKED_OUT ) === true ) { $ updatability [ ] = Updatability :: cast ( Updatability :: WHENCHECKEDOUT ) ; } $ newObjectId = $ objectId ; $ this -> getBinding ( ) -> getObjectService ( ) -> updateProperties ( $ this -> getRepositoryId ( ) , $ newObjectId , $ this -> getObjectFactory ( ) -> convertProperties ( $ properties , $ this -> getObjectType ( ) , ( array ) $ this -> getSecondaryTypes ( ) , $ updatability ) , $ changeToken ) ; $ this -> getSession ( ) -> removeObjectFromCache ( $ this -> getSession ( ) -> createObjectId ( $ objectId ) ) ; if ( $ refresh === true ) { $ this -> refresh ( ) ; } if ( $ newObjectId === null ) { return null ; } return $ this -> getSession ( ) -> getObject ( $ this -> getSession ( ) -> createObjectId ( $ newObjectId ) , $ this -> getCreationContext ( ) ) ; }
|
Updates the provided properties . If the repository created a new object for example a new version the object ID of the new object is returned . Otherwise the object ID of the current object is returned .
|
53,245
|
public function getProperty ( $ id ) { if ( ! isset ( $ this -> properties [ $ id ] ) ) { return null ; } return $ this -> properties [ $ id ] ; }
|
Returns a property .
|
53,246
|
public function getPropertyValue ( $ id ) { $ property = $ this -> getProperty ( $ id ) ; if ( $ property === null ) { return null ; } return $ property -> isMultiValued ( ) ? $ property -> getValues ( ) : $ property -> getFirstValue ( ) ; }
|
Returns the value of a property .
|
53,247
|
public function findObjectType ( $ id ) { $ result = [ ] ; if ( $ this -> getObjectType ( ) -> getPropertyDefinition ( $ id ) !== null ) { $ result [ ] = $ this -> getObjectType ( ) ; } $ secondaryTypes = $ this -> getSecondaryTypes ( ) ; if ( $ secondaryTypes !== null ) { foreach ( $ secondaryTypes as $ secondaryType ) { if ( $ secondaryType -> getPropertyDefinition ( $ id ) !== null ) { $ result [ ] = $ secondaryType ; } } } return empty ( $ result ) ? null : $ result ; }
|
Returns a list of primary and secondary object types that define the given property .
|
53,248
|
public function hasAllowableAction ( Action $ action ) { $ currentAllowableActions = $ this -> getAllowableActions ( ) ; if ( $ currentAllowableActions === null || count ( $ currentAllowableActions -> getAllowableActions ( ) ) === 0 ) { throw new IllegalStateException ( 'Allowable Actions are not available!' ) ; } return in_array ( $ action , $ currentAllowableActions -> getAllowableActions ( ) , false ) ; }
|
Checks if the given action is an allowed action for the object
|
53,249
|
public function applyAcl ( array $ addAces , array $ removeAces , AclPropagation $ aclPropagation ) { $ result = $ this -> getSession ( ) -> applyAcl ( $ this , $ addAces , $ removeAces , $ aclPropagation ) ; $ this -> refresh ( ) ; return $ result ; }
|
Adds and removes ACEs to the object and refreshes this object afterwards .
|
53,250
|
public function setAcl ( array $ aces ) { $ result = $ this -> getSession ( ) -> setAcl ( $ this , $ aces ) ; $ this -> refresh ( ) ; return $ result ; }
|
Removes the direct ACE of this object sets the provided ACEs to the object and refreshes this object afterwards .
|
53,251
|
public function getPermissionsForPrincipal ( $ principalId ) { if ( empty ( $ principalId ) ) { throw new IllegalStateException ( 'Principal ID must be set!' ) ; } $ currentAcl = $ this -> getAcl ( ) ; if ( $ currentAcl === null ) { throw new IllegalStateException ( 'ACLs are not available' ) ; } $ result = [ ] ; foreach ( $ currentAcl -> getAces ( ) as $ ace ) { if ( $ principalId === $ ace -> getPrincipalId ( ) && count ( $ ace -> getPermissions ( ) ) > 0 ) { $ result = array_merge ( $ result , $ ace -> getPermissions ( ) ) ; } } return $ result ; }
|
Returns all permissions for the given principal from the ACL .
|
53,252
|
public function getExtensions ( ExtensionLevel $ level ) { if ( ! isset ( $ this -> extensions [ ( string ) $ level ] ) ) { return null ; } return $ this -> extensions [ ( string ) $ level ] ; }
|
Returns the extensions for the given level .
|
53,253
|
public function refresh ( ) { $ operationContext = $ this -> getCreationContext ( ) ; $ objectData = $ this -> getSession ( ) -> getBinding ( ) -> getObjectService ( ) -> getObject ( $ this -> getRepositoryId ( ) , $ this -> getId ( ) , $ operationContext -> getQueryFilterString ( ) , $ operationContext -> isIncludeAllowableActions ( ) , $ operationContext -> getIncludeRelationships ( ) , $ operationContext -> getRenditionFilterString ( ) , $ operationContext -> isIncludePolicies ( ) , $ operationContext -> isIncludeAcls ( ) , null ) ; $ this -> initialize ( $ this -> getSession ( ) , $ this -> getSession ( ) -> getTypeDefinition ( $ this -> getObjectType ( ) -> getId ( ) ) , $ this -> creationContext , $ objectData ) ; }
|
Reloads this object from the repository .
|
53,254
|
public function refreshIfOld ( $ durationInMillis = 0 ) { if ( $ this -> getRefreshTimestamp ( ) < ( ( round ( microtime ( true ) * 1000 ) ) - ( integer ) $ durationInMillis ) ) { $ this -> refresh ( ) ; } }
|
Reloads the data from the repository if the last refresh did not occur within durationInMillis .
|
53,255
|
public function cancelCheckOut ( $ repositoryId , & $ objectId , ExtensionDataInterface $ extension = null ) { $ objectId = $ this -> getJsonConverter ( ) -> convertObject ( ( array ) $ this -> postJson ( $ this -> getObjectUrl ( $ repositoryId , $ objectId ) , $ this -> createQueryArray ( Constants :: CMISACTION_CANCEL_CHECK_OUT , [ ] , $ extension ) ) ) ; }
|
Reverses the effect of a check - out .
|
53,256
|
public function checkOut ( $ repositoryId , & $ objectId , ExtensionDataInterface $ extension = null , $ contentCopied = null ) { $ objectData = $ this -> getJsonConverter ( ) -> convertObject ( ( array ) $ this -> postJson ( $ this -> getObjectUrl ( $ repositoryId , $ objectId ) , $ this -> createQueryArray ( Constants :: CMISACTION_CHECK_OUT , [ ] , $ extension ) ) ) ; $ objectId = $ objectData -> getId ( ) ; }
|
Create a private working copy of the document .
|
53,257
|
public function all ( ) { $ endpoint = '/admin/users.json' ; $ response = $ this -> request ( $ endpoint ) ; return $ this -> createCollection ( User :: class , $ response [ 'users' ] ) ; }
|
Receive a list of all Users
|
53,258
|
public function get ( $ userId ) { $ endpoint = '/admin/users/' . $ userId . '.json' ; $ response = $ this -> request ( $ endpoint ) ; return $ this -> createObject ( User :: class , $ response [ 'user' ] ) ; }
|
Receive a single user
|
53,259
|
public function appendContentStream ( $ repositoryId , & $ objectId , StreamInterface $ contentStream , $ isLastChunk , & $ changeToken = null , ExtensionDataInterface $ extension = null ) { }
|
Appends the content stream to the content of the document .
|
53,260
|
public function bulkUpdateProperties ( $ repositoryId , array $ objectIdsAndChangeTokens , PropertiesInterface $ properties , array $ addSecondaryTypeIds , array $ removeSecondaryTypeIds , ExtensionDataInterface $ extension = null ) { }
|
Updates properties and secondary types of one or more objects .
|
53,261
|
public function deleteContentStream ( $ repositoryId , & $ objectId , & $ changeToken = null , ExtensionDataInterface $ extension = null ) { if ( empty ( $ objectId ) ) { throw new CmisInvalidArgumentException ( 'Object id must not be empty!' ) ; } $ this -> flushCached ( ) ; $ url = $ this -> getObjectUrl ( $ repositoryId , $ objectId ) ; $ url -> getQuery ( ) -> modify ( [ Constants :: CONTROL_CMISACTION => Constants :: CMISACTION_DELETE_CONTENT , Constants :: PARAM_SUCCINCT => $ this -> getSuccinct ( ) ? 'true' : 'false' ] ) ; if ( $ changeToken !== null && ! $ this -> getSession ( ) -> get ( SessionParameter :: OMIT_CHANGE_TOKENS , false ) ) { $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_CHANGE_TOKEN => $ changeToken ] ) ; } $ newObject = $ this -> getJsonConverter ( ) -> convertObject ( ( array ) $ this -> postJson ( $ url ) ) ; $ objectId = null ; if ( $ newObject !== null ) { $ objectId = $ newObject -> getId ( ) ; $ newObjectProperties = $ newObject -> getProperties ( ) -> getProperties ( ) ; if ( $ changeToken !== null && count ( $ newObjectProperties ) > 0 ) { $ newChangeToken = $ newObjectProperties [ PropertyIds :: CHANGE_TOKEN ] ; $ changeToken = $ newChangeToken === null ? null : $ newChangeToken -> getFirstValue ( ) ; } } }
|
Deletes the content stream for the specified document object .
|
53,262
|
public function deleteObject ( $ repositoryId , $ objectId , $ allVersions = true , ExtensionDataInterface $ extension = null ) { $ url = $ this -> getObjectUrl ( $ repositoryId , $ objectId ) ; $ content = [ Constants :: CONTROL_CMISACTION => Constants :: CMISACTION_DELETE , Constants :: PARAM_ALL_VERSIONS => $ allVersions ? 'true' : 'false' , ] ; $ this -> post ( $ url , $ content ) ; $ this -> flushCached ( ) ; }
|
Deletes the specified object .
|
53,263
|
public function deleteTree ( $ repositoryId , $ folderId , $ allVersions = true , UnfileObject $ unfileObjects = null , $ continueOnFailure = false , ExtensionDataInterface $ extension = null ) { $ url = $ this -> getObjectUrl ( $ repositoryId , $ folderId ) ; $ url -> getQuery ( ) -> modify ( [ Constants :: CONTROL_CMISACTION => Constants :: CMISACTION_DELETE_TREE , Constants :: PARAM_FOLDER_ID => $ folderId , Constants :: PARAM_ALL_VERSIONS => $ allVersions ? 'true' : 'false' , Constants :: PARAM_CONTINUE_ON_FAILURE => $ continueOnFailure ? 'true' : 'false' ] ) ; if ( $ unfileObjects !== null ) { $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_UNFILE_OBJECTS => ( string ) $ unfileObjects ] ) ; } return $ this -> getJsonConverter ( ) -> convertFailedToDelete ( $ this -> postJson ( $ url ) ) ; }
|
Deletes the specified folder object and all of its child - and descendant - objects .
|
53,264
|
public function getContentStream ( $ repositoryId , $ objectId , $ streamId = null , $ offset = null , $ length = null , ExtensionDataInterface $ extension = null ) { if ( empty ( $ objectId ) ) { throw new CmisInvalidArgumentException ( 'Object id must not be empty!' ) ; } $ url = $ this -> getObjectUrl ( $ repositoryId , $ objectId , Constants :: SELECTOR_CONTENT ) ; if ( $ streamId !== null ) { $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_STREAM_ID => $ streamId ] ) ; } $ response = $ this -> getHttpInvoker ( ) -> get ( ( string ) $ url ) ; $ contentStream = $ response -> getBody ( ) ; if ( ! $ contentStream ) { return null ; } if ( $ offset !== null ) { $ contentStream = new LimitStream ( $ contentStream , $ length !== null ? $ length : - 1 , $ offset ) ; } return $ contentStream ; }
|
Gets the content stream for the specified document object or gets a rendition stream for a specified rendition of a document or folder object .
|
53,265
|
public function getObject ( $ repositoryId , $ objectId , $ filter = null , $ includeAllowableActions = false , IncludeRelationships $ includeRelationships = null , $ renditionFilter = Constants :: RENDITION_NONE , $ includePolicyIds = false , $ includeAcl = false , ExtensionDataInterface $ extension = null ) { $ cacheKey = $ this -> createCacheKey ( $ objectId , [ $ repositoryId , $ filter , $ includeAllowableActions , $ includeRelationships , $ renditionFilter , $ includePolicyIds , $ includeAcl , $ extension , $ this -> getSuccinct ( ) ] ) ; if ( $ this -> isCached ( $ cacheKey ) ) { return $ this -> getCached ( $ cacheKey ) ; } $ url = $ this -> getObjectUrl ( $ repositoryId , $ objectId , Constants :: SELECTOR_OBJECT ) ; $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_ALLOWABLE_ACTIONS => $ includeAllowableActions ? 'true' : 'false' , Constants :: PARAM_RENDITION_FILTER => $ renditionFilter , Constants :: PARAM_POLICY_IDS => $ includePolicyIds ? 'true' : 'false' , Constants :: PARAM_ACL => $ includeAcl ? 'true' : 'false' , Constants :: PARAM_SUCCINCT => $ this -> getSuccinct ( ) ? 'true' : 'false' , Constants :: PARAM_DATETIME_FORMAT => ( string ) $ this -> getDateTimeFormat ( ) ] ) ; if ( ! empty ( $ filter ) ) { $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_FILTER => ( string ) $ filter ] ) ; } if ( $ includeRelationships !== null ) { $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_RELATIONSHIPS => ( string ) $ includeRelationships ] ) ; } $ responseData = ( array ) $ this -> readJson ( $ url ) ; return $ this -> cache ( $ cacheKey , $ this -> getJsonConverter ( ) -> convertObject ( $ responseData ) ) ; }
|
Gets the specified information for the object specified by id .
|
53,266
|
public function getProperties ( $ repositoryId , $ objectId , $ filter = null , ExtensionDataInterface $ extension = null ) { $ cacheKey = $ this -> createCacheKey ( $ objectId , [ $ repositoryId , $ filter , $ extension , $ this -> getSuccinct ( ) ] ) ; if ( $ this -> isCached ( $ cacheKey ) ) { return $ this -> getCached ( $ cacheKey ) ; } $ url = $ this -> getObjectUrl ( $ repositoryId , $ objectId , Constants :: SELECTOR_PROPERTIES ) ; $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_SUCCINCT => $ this -> getSuccinct ( ) ? 'true' : 'false' , Constants :: PARAM_DATETIME_FORMAT => ( string ) $ this -> getDateTimeFormat ( ) ] ) ; if ( ! empty ( $ filter ) ) { $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_FILTER => ( string ) $ filter ] ) ; } $ responseData = ( array ) $ this -> readJson ( $ url ) ; if ( $ this -> getSuccinct ( ) ) { $ objectData = $ this -> getJsonConverter ( ) -> convertSuccinctProperties ( $ responseData ) ; } else { $ objectData = $ this -> getJsonConverter ( ) -> convertProperties ( $ responseData ) ; } return $ this -> cache ( $ cacheKey , $ objectData ) ; }
|
Gets the list of properties for an object .
|
53,267
|
public function getRenditions ( $ repositoryId , $ objectId , $ renditionFilter = Constants :: RENDITION_NONE , $ maxItems = null , $ skipCount = 0 , ExtensionDataInterface $ extension = null ) { if ( empty ( $ objectId ) ) { throw new CmisInvalidArgumentException ( 'Object id must not be empty!' ) ; } if ( ! is_int ( $ skipCount ) ) { throw new CmisInvalidArgumentException ( 'Skip count must be of type integer!' ) ; } $ url = $ this -> getObjectUrl ( $ repositoryId , $ objectId , Constants :: SELECTOR_RENDITIONS ) ; $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_RENDITION_FILTER => $ renditionFilter , Constants :: PARAM_SKIP_COUNT => ( string ) $ skipCount , ] ) ; if ( $ maxItems !== null ) { $ url -> getQuery ( ) -> modify ( [ Constants :: PARAM_MAX_ITEMS => ( string ) $ maxItems ] ) ; } $ responseData = ( array ) $ this -> readJson ( $ url ) ; return $ this -> getJsonConverter ( ) -> convertRenditions ( $ responseData ) ; }
|
Gets the list of associated renditions for the specified object . Only rendition attributes are returned not rendition stream .
|
53,268
|
public function moveObject ( $ repositoryId , & $ objectId , $ targetFolderId , $ sourceFolderId , ExtensionDataInterface $ extension = null ) { $ this -> flushCached ( ) ; $ url = $ this -> getObjectUrl ( $ repositoryId , $ objectId ) ; $ url -> getQuery ( ) -> modify ( [ Constants :: CONTROL_CMISACTION => Constants :: CMISACTION_MOVE , Constants :: PARAM_TARGET_FOLDER_ID => $ targetFolderId , Constants :: PARAM_SOURCE_FOLDER_ID => $ sourceFolderId , Constants :: PARAM_SUCCINCT => $ this -> getSuccinct ( ) ? 'true' : 'false' ] ) ; $ newObject = $ this -> getJsonConverter ( ) -> convertObject ( $ this -> postJson ( $ url ) ) ; $ objectId = ( $ newObject === null ) ? null : $ newObject -> getId ( ) ; return $ newObject ; }
|
Moves the specified file - able object from one folder to another .
|
53,269
|
public function all ( array $ params = array ( ) ) { $ endpoint = '/admin/collects.json' ; $ data = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createCollection ( Collect :: class , $ data [ 'collects' ] ) ; }
|
Receive a list of all collects
|
53,270
|
public function get ( $ collectId , array $ fields = array ( ) ) { $ params = array ( ) ; if ( ! empty ( $ fields ) ) { $ params [ 'fields' ] = implode ( ',' , $ fields ) ; } $ endpoint = '/admin/collects/' . $ collectId . '.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createObject ( Collect :: class , $ response [ 'collect' ] ) ; }
|
Receive a single collect
|
53,271
|
public function create ( Collect & $ collect ) { $ data = $ collect -> exportData ( ) ; $ endpoint = '/admin/collects.json' ; $ response = $ this -> request ( $ endpoint , 'POST' , array ( 'collect' => $ data ) ) ; $ collect -> setData ( $ response [ 'collect' ] ) ; }
|
Create a new collect
|
53,272
|
public function all ( array $ params = array ( ) ) { $ data = $ this -> request ( '/admin/application_charges.json' , 'GET' , $ params ) ; return $ this -> createCollection ( ApplicationCharge :: class , $ data [ 'application_charges' ] ) ; }
|
Retrieve all one - time application charges
|
53,273
|
public function get ( $ applicationChargeId , array $ fields = array ( ) ) { $ params = array ( ) ; if ( ! empty ( $ fields ) ) { $ params [ 'fields' ] = implode ( ',' , $ fields ) ; } $ data = $ this -> request ( '/admin/application_charges/' . $ applicationChargeId . '.json' , 'GET' , $ params ) ; return $ this -> createObject ( ApplicationCharge :: class , $ data [ 'application_charge' ] ) ; }
|
Receive a single ApplicationCharge
|
53,274
|
public function create ( ApplicationCharge & $ applicationCharge ) { $ data = $ applicationCharge -> exportData ( ) ; $ endpoint = '/admin/application_charges.json' ; $ response = $ this -> request ( '/admin/application_charges.json' , 'POST' , array ( 'application_charge' => $ data ) ) ; $ applicationCharge -> setData ( $ response [ 'application_charge' ] ) ; }
|
Create a new one - time application charge
|
53,275
|
public function activate ( ApplicationCharge & $ applicationCharge ) { $ response = $ this -> request ( '/admin/application_charges/' . $ applicationCharge -> id . '/activate.json' , 'POST' ) ; $ applicationCharge -> setData ( $ response [ 'application_charge' ] ) ; }
|
Activate a one - time application charge
|
53,276
|
public function getBaseTypeId ( ) { $ value = $ this -> getFirstValue ( PropertyIds :: BASE_TYPE_ID ) ; if ( is_string ( $ value ) ) { try { return BaseTypeId :: cast ( $ value ) ; } catch ( InvalidEnumerationValueException $ e ) { } } return null ; }
|
Returns the base object type .
|
53,277
|
public function getId ( ) { $ value = $ this -> getFirstValue ( PropertyIds :: OBJECT_ID ) ; if ( is_string ( $ value ) ) { return $ value ; } return null ; }
|
Returns the object ID .
|
53,278
|
public function all ( array $ params = array ( ) ) { $ endpoint = '/admin/gift_cards.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createCollection ( GiftCard :: class , $ response [ 'gift_cards' ] ) ; }
|
Receive a list of Gift Cards
|
53,279
|
public function get ( $ giftCardId , array $ params = array ( ) ) { $ endpoint = '/admin/gift_cards/' . $ giftCardId . '.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createObject ( GiftCard :: class , $ response [ 'gift_card' ] ) ; }
|
Receive a single Gift Card
|
53,280
|
public function create ( GiftCard & $ giftCard ) { $ data = $ giftCard -> exportData ( ) ; $ endpoint = '/admin/gift_cards.json' ; $ response = $ this -> request ( $ endpoint , 'POST' , array ( 'gift_card' => $ data ) ) ; $ giftCard -> setData ( $ response [ 'gift_card' ] ) ; }
|
Create a gift card
|
53,281
|
public function update ( GiftCard & $ giftCard ) { $ data = $ giftCard -> exportData ( ) ; $ endpoint = '/admin/gift_cards/' . $ giftCard -> id . '.json' ; $ response = $ this -> request ( $ endpoint , 'POST' , array ( 'gift_card' => $ data ) ) ; $ giftCard -> setData ( $ response [ 'gift_card' ] ) ; }
|
Update a Gift Card
|
53,282
|
public function search ( array $ params = array ( ) ) { $ endpoint = '/admin/gift_cards/search.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createCollection ( GiftCard :: class , $ response [ 'gift_cards' ] ) ; }
|
Search for gift cards matching supplied query
|
53,283
|
public function all ( array $ params = array ( ) ) { $ endpoint = '/admin/custom_collections.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createCollection ( CustomCollection :: class , $ response [ 'custom_collections' ] ) ; }
|
Receive a list of all custom collections
|
53,284
|
public function get ( $ customCollectionId , array $ fields = array ( ) ) { $ params = array ( ) ; if ( ! empty ( $ fields ) ) { $ params [ 'fields' ] = $ fields ; } $ endpoint = '/admin/custom_collections/' . $ customCollectionId . '.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createObject ( CustomCollection :: class , $ response [ 'custom_collection' ] ) ; }
|
Receive a single custom collection
|
53,285
|
public function update ( CustomCollection & $ customCollection ) { $ data = $ customCollection -> exportData ( ) ; $ endpoint = '/admin/custom_collections/' . $ customCollection -> id . '.json' ; $ response = $ this -> request ( $ endpoint , 'PUT' , array ( 'custom_collection' => $ data ) ) ; $ customCollection -> setData ( $ response [ 'custom_collection' ] ) ; }
|
Update a custom collection
|
53,286
|
public function delete ( CustomCollection & $ customCollection ) { $ endpoint = '/admin/custom_collections/' . $ customCollection -> getId ( ) . '.json' ; $ request = $ this -> createRequest ( $ endpoint , static :: REQUEST_METHOD_DELETE ) ; $ response = $ this -> send ( $ request ) ; return ; }
|
Delete a custom collection
|
53,287
|
public function count ( $ productId , array $ params = array ( ) ) { $ endpoint = '/admin/products/' . $ productId . '/images/count.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ response [ 'count' ] ; }
|
Receive a count of all Product Images
|
53,288
|
public function get ( $ productId , $ productImageId ) { $ endpoint = '/admin/products/' . $ productId . '/images/' . $ productImageId . '.json' ; $ response = $ this -> request ( $ endpoint , 'GET' ) ; return $ this -> createObject ( ProductImage :: class , $ response [ 'image' ] ) ; }
|
Get a single product image
|
53,289
|
public function create ( $ productId , ProductImage & $ productImage ) { $ data = $ productImage -> exportData ( ) ; $ endpoint = '/admin/products/' . $ productId . '/images.json' ; $ response = $ this -> request ( $ endpoint , 'POST' , array ( 'image' => $ data ) ) ; $ productImage -> setData ( $ response [ 'image' ] ) ; }
|
Create a new product Image
|
53,290
|
public function update ( $ productId , ProductImage & $ productImage ) { $ data = $ productImage -> exportData ( ) ; $ endpoint = '/admin/products/' . $ productId . '/images/' . $ productImage -> id . '.json' ; $ response = $ this -> request ( $ endpoint , 'PUT' , array ( 'image' => $ data ) ) ; $ productImage -> setData ( $ response [ 'image' ] ) ; }
|
Modify an existing product image
|
53,291
|
public function delete ( $ productId , ProductImage $ productImage ) { $ endpoint = '/admin/products/' . $ productId . '/images/' . $ productImage -> id . '.json' ; return $ this -> request ( $ endpoint , 'DELETE' ) ; }
|
Delete a product image
|
53,292
|
public function setChildren ( array $ children ) { foreach ( $ children as $ child ) { $ this -> checkType ( ObjectInFolderContainerInterface :: class , $ child ) ; } $ this -> children = $ children ; }
|
checks input array for ObjectInFolderContainerInterface and sets objects
|
53,293
|
public function compile ( $ value ) { if ( ! $ this -> enabled || ! $ this -> hasShortcodes ( ) ) return $ value ; $ result = '' ; foreach ( token_get_all ( $ value ) as $ token ) { $ result .= is_array ( $ token ) ? $ this -> parseToken ( $ token ) : $ token ; } return $ result ; }
|
Compile the contents
|
53,294
|
public function all ( array $ params = array ( ) ) { $ data = $ this -> request ( '/admin/checkouts.json' , 'GET' , $ params ) ; return $ this -> createCollection ( AbandonedCheckout :: class , $ data [ 'checkouts' ] ) ; }
|
List all abandonded checkouts
|
53,295
|
public function all ( array $ params = array ( ) ) { $ endpoint = '/admin/comments.json' ; $ response = $ this -> request ( $ endpoint , 'GET' , $ params ) ; return $ this -> createCollection ( Comment :: class , $ response [ 'comments' ] ) ; }
|
Receive a list of all comments
|
53,296
|
public function get ( $ commentId , array $ params = array ( ) ) { $ endpoint = '/admin/comments/' . $ commentId . '.json' ; $ response = $ this -> request ( $ endpoint ) ; return $ this -> createObject ( Comment :: class , $ response [ 'comment' ] ) ; }
|
Receive a single comment
|
53,297
|
public function create ( Comment & $ comment ) { $ data = $ comment -> exportData ( ) ; $ endpoint = '/admin/comments.json' ; $ respoinse = $ this -> request ( $ endpoint , 'POST' , array ( 'comment' => $ data ) ) ; $ comment -> setData ( $ response [ 'comment' ] ) ; }
|
Create a new comment
|
53,298
|
public function update ( Comment & $ comment ) { $ data = $ comment -> exportData ( ) ; $ endpoint = '/admin/comments/' . $ comment -> id . '.json' ; $ response = $ this -> request ( $ endpoint , 'PUT' , array ( 'comment' => $ data ) ) ; $ comment -> setData ( $ response [ 'comment' ] ) ; }
|
Modify an existing comment
|
53,299
|
public function spam ( Comment & $ comment ) { $ endpoint = '/admin/comments/' . $ comment -> id . '/spam.json' ; $ response = $ this -> request ( $ endpoint , 'POST' ) ; $ comment -> setData ( $ response [ 'comment' ] ) ; }
|
Mark comment as spam
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.