sentence1 stringlengths 52 3.87M | sentence2 stringlengths 1 47.2k | label stringclasses 1
value |
|---|---|---|
public function all(array $params)
{
$endpoint = '/admin/inventory_levels.json';
$response = $this->request($endpoint, 'GET', $params);
return $this->createCollection(InventoryLevel::class, $response['inventory_levels']);
} | Retrieves a list of inventory levels.
You must include inventory_item_ids and/or location_ids as filter params.
@link https://help.shopify.com/api/reference/inventorylevel#index
@param array $params
@return InventoryLevel[] | entailment |
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
@link https://help.shopify.com/api/reference/applicationcredit#index
@param array $params
@return ApplicationCredit[] | entailment |
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, 'G... | Receive a single ApplicationCredit
@link https://help.shopify.com/api/reference/applicationcredit#show
@param integer $applicationCreditId
@param array $fields
@return ApplicationCredit | entailment |
public function create(ApplicationCredit &$applicationCredit)
{
$data = $applicationCredit->exportData();
$endpoint = '/admin/application_credits.json';
$response = $this->request(
$endpoint, 'POST', array(
'application_charge' => $data
)
);
... | Create an application credit
@link https://help.shopify.com/api/reference/applicationcredit#create
@param ApplicationCredit $applicationCredit
@return void | entailment |
public function setList(array $list)
{
foreach ($list as $item) {
$this->checkType(TypeDefinitionInterface::class, $item);
}
$this->list = $list;
} | Set a list of type definitions
@param TypeDefinitionInterface[] $list | entailment |
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
@link https://help.shopify.com/api/reference/fulfillmentevent#index
@param integer $orderId
@param integer $fulfillmentId
@return FulfillmentEvent[] | entailment |
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... | Get a specific fulfillment event
@link https://help.shopify.com/api/reference/fulfillmentevent#show
@param integer $orderId
@param integer $fulfillmentId
@param integer $fulfillmentEventId
@return FulfillmentEvent | entailment |
public function create($orderId, $fulfillmentId, FulfillmentEvent &$fulfillmentEvent)
{
$data = $fulfillmentEvent->exportData();
$endpoint = '/admin/orders/'.$orderId.'/fulfillments/'.$fulfillmentId.'/events.json';
$response = $this->request(
$endpoint, 'POST', array(
... | Create a fulfillment event
@link https://help.shopify.com/api/reference/fulfillmentevent#create
@param integer $orderId
@param integer $fulfillmentId
@param FulfillmentEvent $fulfillmentEvent
@return void | entailment |
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
@link https://help.shopify.com/api/reference/fulfillmentevent#destroy
@param integer $orderId
@param integer $fulfillmentId
@param FulfillmentEvent $fulfillmentEvent
@return void | entailment |
public function setValues(array $values)
{
foreach ($values as & $value) {
if (PHP_INT_SIZE == 4 && is_double($value)) {
//TODO: 32bit - handle this specially?
$value = $this->castValueToSimpleType('integer', $value);
}
$this->checkType('... | {@inheritdoc}
@param integer[] $values | entailment |
public function getCacheKey()
{
$cacheKey = $this->isIncludeAcls() ? '1' : '0';
$cacheKey .= $this->isIncludeAllowableActions() ? '1' : '0';
$cacheKey .= $this->isIncludePolicies() ? '1' : '0';
$cacheKey .= $this->isIncludePathSegments() ? '1' : '0';
$cacheKey .= '|';
... | {@inheritdoc} | entailment |
public function setFilter(array $propertyFilters)
{
$filters = [];
foreach ($propertyFilters as $filter) {
$filter = trim((string) $filter);
if ($filter === '') {
continue;
}
if (self::PROPERTIES_WILDCARD === $filter) {
... | {@inheritdoc} | entailment |
public function setMaxItemsPerPage($maxItemsPerPage)
{
if ((int) $maxItemsPerPage < 1) {
throw new \InvalidArgumentException('itemsPerPage must be > 0!');
}
$this->maxItemsPerPage = (int) $maxItemsPerPage;
return $this;
} | {@inheritdoc} | entailment |
public function setRenditionFilter(array $renditionFilter)
{
$filters = [];
foreach ($renditionFilter as $filter) {
$filter = trim((string) $filter);
if ($filter === '') {
continue;
}
if (stripos($filter, ',') !== false) {
... | {@inheritdoc} | entailment |
public function getQueryFilterString()
{
if (count($this->filter) === 0) {
return null;
}
if (array_search(self::PROPERTIES_WILDCARD, $this->filter)) {
return self::PROPERTIES_WILDCARD;
}
$filters = $this->filter;
$filters[] = PropertyIds::OB... | {@inheritdoc} | entailment |
public function setFilterString($propertyFilter)
{
if (empty($propertyFilter)) {
$this->setFilter([]);
} else {
$this->setFilter(explode(',', $propertyFilter));
}
return $this;
} | {@inheritdoc} | entailment |
public function setRenditionFilterString($renditionFilter)
{
if (empty($renditionFilter)) {
$this->setRenditionFilter([]);
} else {
$this->setRenditionFilter(explode(',', $renditionFilter));
}
return $this;
} | {@inheritdoc} | entailment |
public function setValues(array $values)
{
$this->values = [];
if (is_array($values)) {
$this->values = array_values($values);
}
} | {@inheritdoc} | entailment |
public function all(array $params = array())
{
$endpoint = '/admin/orders.json';
$response = $this->request($endpoint, 'GET', $params);
return $this->createCollection(Order::class, $response['orders']);
} | Retrieve a list of Orders (OPEN Orders by default, use status=any for ALL orders)
@link https://help.shopify.com/api/reference/order#index
@param array $params
@return Order[] | entailment |
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
@link https://help.shopify.com/api/reference/order#count
@param integer $orderId
@param array $params
@return Order | entailment |
public function create(Order &$order)
{
$data = $order->exportData();
$endpoint = '/admin/orders.json';
$response = $this->request(
$endpoint, 'POST', array(
'order' => $data
)
);
$order->setData($response['order']);
} | Create a new order
@link https://help.shopify.com/api/reference/order#create
@param Order $order
@return void | entailment |
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
@link https://help.shopify.com/api/reference/order#close
@param Order $order
@return void | entailment |
protected function generateStatementFromPropertiesAndTypesLists(
array $selectPropertyIds,
array $fromTypes,
$whereClause,
array $orderByPropertyIds
) {
$statementString = 'SELECT ' . $this->generateStatementPropertyList($selectPropertyIds, false);
$primaryTable = ar... | Generates a statement based on input criteria, with the necessary
JOINs in place for selecting attributes related to all provided types.
@param array $selectPropertyIds An array PropertyDefinitionInterface
or strings, can be mixed. When strings are provided those can be
either the actual ID of the property or the quer... | entailment |
protected function getQueryNameAndAliasForType($typeDefinitionMixed, $autoAlias)
{
$alias = null;
if (is_array($typeDefinitionMixed)) {
list ($typeDefinitionMixed, $alias) = $typeDefinitionMixed;
}
if ($typeDefinitionMixed instanceof TypeDefinitionInterface) {
... | 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.
@param mixed $typeDefinitionMixed Input describing the t... | entailment |
protected function generateStatementPropertyList(array $properties, $withOrdering)
{
$statement = [];
foreach ($properties as $property) {
$ordering = ($withOrdering ? 'ASC' : '');
if ($withOrdering) {
if (is_array($property)) {
list ($prop... | Renders a statement-compatible string of property selections,
with ordering support if $withOrdering is true. Input properties
can be an array of strings, an array of PropertyDefinition, or
when $withOrdering is true, an array of arrays each containing
a string or PropertyDefinition plus ASC or DESC as second value.
@... | entailment |
public function query($searchAllVersions, OperationContextInterface $context = null)
{
return $this->session->query($this->toQueryString(), $searchAllVersions, $context);
} | Executes the query.
@param boolean $searchAllVersions <code>true</code> if all document versions should be included in the search
results, <code>false</code> if only the latest document versions should be included in the search results
@param OperationContextInterface|null $context the operation context to use
@return... | entailment |
public function setDateTime($parameterIndex, \DateTime $dateTime)
{
$this->setParameter($parameterIndex, $dateTime->format(Constants::QUERY_DATETIMEFORMAT));
} | Sets the designated parameter to the given DateTime value.
@param integer $parameterIndex the parameter index (one-based)
@param \DateTime $dateTime the DateTime value as DateTime object | entailment |
public function setId($parameterIndex, ObjectIdInterface $id)
{
$this->setParameter($parameterIndex, $this->escape($id->getId()));
} | Sets the designated parameter to the given object ID.
@param integer $parameterIndex the parameter index (one-based)
@param ObjectIdInterface $id the object ID | entailment |
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.
@param integer $parameterIndex the parameter index (one-based)
@param integer $number the value to be set as number
@throws CmisInvalidArgumentException If number not of type integer | entailment |
public function setProperty($parameterIndex, PropertyDefinitionInterface $propertyDefinition)
{
$queryName = $propertyDefinition->getQueryName();
if (empty($queryName)) {
throw new CmisInvalidArgumentException('Property has no query name!');
}
$this->setParameter($parame... | Sets the designated parameter to the query name of the given property.
@param integer $parameterIndex the parameter index (one-based)
@param PropertyDefinitionInterface $propertyDefinition
@throws CmisInvalidArgumentException If property has no query name | entailment |
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.
@param integer $parameterIndex the parameter index (one-based)
@param string $string the string
@throws CmisInvalidArgumentException If given value is not a string | entailment |
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.
Note that the CMIS specification requires two levels of escaping. The first level escapes ', ", \ characters
to \', \" and \\. The characters *, ? and - are interpreted as text search operators and are not escaped
on first level.
If *, ?, ... | entailment |
public function setStringLike($parameterIndex, $string)
{
if (!is_string($string)) {
throw new CmisInvalidArgumentException('Parameter string must be of type string!');
}
$this->setParameter($parameterIndex, $this->escapeLike($string));
} | Sets the designated parameter to the given string.
It does not escape backslashes ('\') in front of '%' and '_'.
@param integer $parameterIndex the parameter index (one-based)
@param $string
@throws CmisInvalidArgumentException If given value is not a string | entailment |
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.
@param integer $parameterIndex the parameter index (one-based)
@param ObjectTypeInterface $type the object type | entailment |
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
@param integer $parameterIndex
@param mixed $value
@throws CmisInvalidArgumentException If parameter index is not of type integer | entailment |
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 && $thi... | Returns the query statement.
@return string the query statement, not null | entailment |
protected function escapeLike($string)
{
$escapedString = addcslashes($string, '\'\\');
$replace = [
'\\\\%' => '\\%',
'\\\\_' => '\\_',
];
$escapedString = str_replace(array_keys($replace), array_values($replace), $escapedString);
return "'" . $escape... | Escapes string, but not escapes backslashes ('\') in front of '%' and '_'.
@param $string
@return string | entailment |
protected function escapeContains($string)
{
$escapedString = addcslashes($string, '"\'\\');
$replace = [
'\\\\*' => '\*',
'\\\\?' => '\?',
];
$escapedString = str_replace(array_keys($replace), array_values($replace), $escapedString);
return "'" . $esc... | Escapes string, but not escapes backslashes ('\') in front of '*' and '?'.
@param $string
@return string | entailment |
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
@param string $entry Entry
@return boolean|null TRUE = allowed, FALSE = rejected, NULL = not handled | entailment |
public function getMatchingEntries()
{
if ($this->matchingEntries === null) {
$this->matchingEntries = array();
foreach ($this->entries as $entry) {
$this->matchingEntries = array_merge($this->matchingEntries, $entry->getMatchingEntries());
}
}
... | Resolve all entries match the list
@return array | entailment |
public function initialize(
SessionInterface $session,
ObjectTypeInterface $objectType,
OperationContextInterface $context,
ObjectDataInterface $objectData = null
) {
if (count($this->getMissingBaseProperties($objectType->getPropertyDefinitions())) !== 0) {
throw ... | Initialize the CMIS Object
@param SessionInterface $session
@param ObjectTypeInterface $objectType
@param OperationContextInterface $context
@param ObjectDataInterface|null $objectData | entailment |
private function initializeObjectData(ObjectDataInterface $objectData)
{
// handle properties
if ($objectData->getProperties() !== null) {
$this->initializeObjectDataProperties($objectData->getProperties());
}
// handle allowable actions
if ($objectData->getAllow... | Handle initialization for objectData
@param ObjectDataInterface $objectData | entailment |
private function initializeObjectDataProperties(PropertiesInterface $properties)
{
// get secondary types
$propertyList = $properties->getProperties();
if (isset($propertyList[PropertyIds::SECONDARY_OBJECT_TYPE_IDS])) {
$this->secondaryTypes = [];
foreach ($propertyLi... | Handle initialization of properties from the object data
@param PropertiesInterface $properties | entailment |
private function initializeObjectDataPolicies(PolicyIdListInterface $policies)
{
foreach ($policies->getPolicyIds() as $policyId) {
$policy = $this->getSession()->getObject($this->getSession()->createObjectId($policyId));
if ($policy instanceof PolicyInterface) {
$thi... | Handle initialization of policies from the object data
@param PolicyIdListInterface $policies | entailment |
protected function getMissingBaseProperties(array $properties = null)
{
$basePropertyKeys = PropertyIds::getBasePropertyKeys();
if ($properties === null) {
return $basePropertyKeys;
}
foreach ($properties as $property) {
$propertyId = $property->getId();
... | Returns a list of missing property keys
@param PropertyDefinitionInterface[]|null $properties
@return array | entailment |
protected function getPropertyQueryName($propertyId)
{
$propertyDefinition = $this->getObjectType()->getPropertyDefinition($propertyId);
if ($propertyDefinition === null) {
return null;
}
return $propertyDefinition->getQueryName();
} | Returns the query name of a property.
@param string $propertyId
@return null|string | entailment |
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 = [];
... | 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.
@param mixed[] $properties the properties to update
@param boolean $refresh <code>true</code> if this object should... | entailment |
public function rename($newName, $refresh = true)
{
if (empty($newName)) {
throw new CmisInvalidArgumentException('New name must not be empty!');
}
$properties = [
PropertyIds::NAME => $newName,
];
$object = $this->updateProperties($properties, $refr... | Renames this object (changes the value of cmis:name).
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.
@param string $newName the new name, not <code>null</code> or empty
@param boolean $refresh <c... | entailment |
public function getBaseType()
{
$baseType = $this->getBaseTypeId();
if ($baseType === null) {
return null;
}
return $this->getSession()->getTypeDefinition((string) $baseType);
} | Returns the base type of this CMIS object (object type identified by cmis:baseTypeId).
@return ObjectTypeInterface the base type of the object or <code>null</code> if the property cmis:baseTypeId
hasn't been requested or hasn't been provided by the repository | entailment |
public function getBaseTypeId()
{
$baseTypeProperty = $this->getProperty(PropertyIds::BASE_TYPE_ID);
if ($baseTypeProperty === null) {
return null;
}
return BaseTypeId::cast($baseTypeProperty->getFirstValue());
} | Returns the base type of this CMIS object (object type identified by cmis:baseTypeId).
@return BaseTypeId|null the base type of the object or <code>null</code> if the property
cmis:baseTypeId hasn't been requested or hasn't been provided by the repository | entailment |
public function getProperty($id)
{
if (!isset($this->properties[$id])) {
return null;
}
return $this->properties[$id];
} | Returns a property.
@param string $id the ID of the property
@return PropertyInterface|null the property or <code>null</code> if the property hasn't been requested or
hasn't been provided by the repository | entailment |
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.
@param string $id the ID of the property
@return mixed the property value or <code>null</code> if the property hasn't been requested,
hasn't been provided by the repository, or the property value isn't set | entailment |
public function findObjectType($id)
{
$result = [];
if ($this->getObjectType()->getPropertyDefinition($id) !== null) {
$result[] = $this->getObjectType();
}
$secondaryTypes = $this->getSecondaryTypes();
if ($secondaryTypes !== null) {
foreach ($secon... | Returns a list of primary and secondary object types that define the given property.
@param string $id the ID of the property
@return ObjectTypeInterface[]|null a list of object types that define the given property or <code>null</code>
if the property could not be found in the object types that are attached to this ob... | entailment |
public function hasAllowableAction(Action $action)
{
$currentAllowableActions = $this->getAllowableActions();
if ($currentAllowableActions === null || count($currentAllowableActions->getAllowableActions()) === 0) {
throw new IllegalStateException('Allowable Actions are not available!');
... | Checks if the given action is an allowed action for the object
@param Action $action
@return boolean | entailment |
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.
@param AceInterface[] $addAces
@param AceInterface[] $removeAces
@param AclPropagation $aclPropagation
@return AclInterface the new ACL of this object | entailment |
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.
@param AceInterface[] $aces
@return AclInterface | entailment |
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 ava... | Returns all permissions for the given principal from the ACL.
@param string $principalId the principal ID
@return string[] the set of permissions for this user, or an empty set if principal is not in the ACL
@throws IllegalStateException if the ACL hasn't been fetched or provided by the repository | entailment |
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.
@param ExtensionLevel $level the level
@return array[]|null A list of <code>CmisExtensionElementInterface</code> at the requested level or
<code>null</code> if there are no extensions for the requested level
@see CmisExtensionElementInterface | entailment |
public function refresh()
{
$operationContext = $this->getCreationContext();
$objectData = $this->getSession()->getBinding()->getObjectService()->getObject(
$this->getRepositoryId(),
$this->getId(),
$operationContext->getQueryFilterString(),
$operatio... | Reloads this object from the repository.
@throws CmisObjectNotFoundException - if the object doesn't exist anymore in the repository | entailment |
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.
@param integer $durationInMillis
@throws CmisObjectNotFoundException - if the object doesn't exist anymore in the repository | entailment |
public function cancelCheckOut($repositoryId, & $objectId, ExtensionDataInterface $extension = null)
{
$objectId = $this->getJsonConverter()->convertObject(
(array) $this->postJson(
$this->getObjectUrl($repositoryId, $objectId),
$this->createQueryArray(
... | Reverses the effect of a check-out.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the PWC
@param ExtensionDataInterface|null $extension | entailment |
public function checkIn(
$repositoryId,
& $objectId,
$major = true,
PropertiesInterface $properties = null,
StreamInterface $contentStream = null,
$checkinComment = null,
array $policies = [],
AclInterface $addAces = null,
AclInterface $removeAces ... | Checks-in the private working copy (PWC) document.
@param string $repositoryId the identifier for the repository
@param string $objectId input: the identifier for the PWC,
output: the identifier for the newly created version document
@param boolean $major indicator if the new version should become a major (<code>true<... | entailment |
public function checkOut(
$repositoryId,
& $objectId,
ExtensionDataInterface $extension = null,
$contentCopied = null
) {
$objectData = $this->getJsonConverter()->convertObject(
(array) $this->postJson(
$this->getObjectUrl($repositoryId, $objectId)... | Create a private working copy of the document.
@param string $repositoryId the identifier for the repository
@param string $objectId input: the identifier for the document that should be checked out,
output: the identifier for the newly created PWC
@param ExtensionDataInterface|null $extension
@param boolean|null $con... | entailment |
public function getAllVersions(
$repositoryId,
$objectId,
$versionSeriesId,
$filter = null,
$includeAllowableActions = false,
ExtensionDataInterface $extension = null
) {
return $this->getJsonConverter()->convertObjectList(
[
'objec... | Returns the list of all document objects in the specified version series,
sorted by the property "cmis:creationDate" descending.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the object
@param string $versionSeriesId the identifier for the object
@param string... | entailment |
public function all()
{
$endpoint = '/admin/users.json';
$response = $this->request($endpoint);
return $this->createCollection(User::class, $response['users']);
} | Receive a list of all Users
@link https://help.shopify.com/api/reference/user#index
@return User[] | entailment |
public function get($userId)
{
$endpoint = '/admin/users/'.$userId.'.json';
$response = $this->request($endpoint);
return $this->createObject(User::class, $response['user']);
} | Receive a single user
@link https://help.shopify.com/api/reference/user#show
@param integer $userId
@return User | entailment |
function start($id, $group = 'default', $doNotTestCacheValidity = false)
{
$this->nestedIds[] = $id;
$this->nestedGroups[] = $group;
$data = $this->get($id, $group, $doNotTestCacheValidity);
if ($data !== false) {
return $data;
}
ob_start();
ob_implicit_flu... | Start the cache
@param string $id cache id
@param string $group name of the cache group
@param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
@return boolean|string false if the cache is not hit else the data
@access public | entailment |
function end()
{
$data = ob_get_contents();
ob_end_clean();
$id = array_pop($this->nestedIds);
$group = array_pop($this->nestedGroups);
$this->save($data, $id, $group);
return $data;
} | Stop the cache
@param boolen
@return string return contents of cache | entailment |
public function appendContentStream(
$repositoryId,
& $objectId,
StreamInterface $contentStream,
$isLastChunk,
& $changeToken = null,
ExtensionDataInterface $extension = null
) {
// TODO: Implement appendContentStream() method.
} | Appends the content stream to the content of the document.
The stream in contentStream is consumed but not closed by this method.
@param string $repositoryId the identifier for the repository
@param string $objectId The identifier for the object. The repository might return a different/new object id
@param StreamInte... | entailment |
public function bulkUpdateProperties(
$repositoryId,
array $objectIdsAndChangeTokens,
PropertiesInterface $properties,
array $addSecondaryTypeIds,
array $removeSecondaryTypeIds,
ExtensionDataInterface $extension = null
) {
// TODO: Implement bulkUpdateProperti... | Updates properties and secondary types of one or more objects.
@param string $repositoryId the identifier for the repository
@param BulkUpdateObjectIdAndChangeTokenInterface[] $objectIdsAndChangeTokens
@param PropertiesInterface $properties
@param string[] $addSecondaryTypeIds the secondary types to apply
@param strin... | entailment |
public function createDocument(
$repositoryId,
PropertiesInterface $properties,
$folderId = null,
StreamInterface $contentStream = null,
VersioningState $versioningState = null,
array $policies = [],
AclInterface $addAces = null,
AclInterface $removeAces =... | Creates a document object of the specified type (given by the cmis:objectTypeId property)
in the (optionally) specified location.
@param string $repositoryId the identifier for the repository
@param PropertiesInterface $properties the property values that must be applied to the newly
created document object
@param str... | entailment |
public function createDocumentFromSource(
$repositoryId,
$sourceId,
PropertiesInterface $properties,
$folderId = null,
VersioningState $versioningState = null,
array $policies = [],
AclInterface $addAces = null,
AclInterface $removeAces = null,
Ext... | Creates a document object as a copy of the given source document in the (optionally) specified location.
@param string $repositoryId the identifier for the repository
@param string $sourceId the identifier for the source document
@param PropertiesInterface $properties the property values that must be applied to the ne... | entailment |
public function createFolder(
$repositoryId,
PropertiesInterface $properties,
$folderId,
array $policies = [],
AclInterface $addAces = null,
AclInterface $removeAces = null,
ExtensionDataInterface $extension = null
) {
$url = $this->getObjectUrl($repos... | Creates a folder object of the specified type (given by the cmis:objectTypeId property) in
the specified location.
@param string $repositoryId the identifier for the repository
@param PropertiesInterface $properties the property values that must be applied to the newly
created document object
@param string $folderId i... | entailment |
public function createPolicy(
$repositoryId,
PropertiesInterface $properties,
$folderId = null,
array $policies = [],
AclInterface $addAces = null,
AclInterface $removeAces = null,
ExtensionDataInterface $extension = null
) {
// TODO: Implement createP... | Creates a policy object of the specified type (given by the cmis:objectTypeId property).
@param string $repositoryId The identifier for the repository
@param PropertiesInterface $properties The property values that must be applied to the newly
created document object
@param string|null $folderId If specified, the iden... | entailment |
public function createRelationship(
$repositoryId,
PropertiesInterface $properties,
array $policies = [],
AclInterface $addAces = null,
AclInterface $removeAces = null,
ExtensionDataInterface $extension = null
) {
$url = $this->getRepositoryUrl($repositoryId);... | Creates a relationship object of the specified type (given by the cmis:objectTypeId property).
@param string $repositoryId the identifier for the repository
@param PropertiesInterface $properties the property values that must be applied to the newly
created document object
@param string[] $policies a list of policy ID... | entailment |
public function deleteContentStream(
$repositoryId,
& $objectId,
& $changeToken = null,
ExtensionDataInterface $extension = null
) {
if (empty($objectId)) {
throw new CmisInvalidArgumentException('Object id must not be empty!');
}
$this->flushCach... | Deletes the content stream for the specified document object.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the object. The repository might return a different/new object id
@param string|null $changeToken the last change token of this object that the client r... | entailment |
public function deleteObject(
$repositoryId,
$objectId,
$allVersions = true,
ExtensionDataInterface $extension = null
) {
$url = $this->getObjectUrl($repositoryId, $objectId);
$content = [
Constants::CONTROL_CMISACTION => Constants::CMISACTION_DELETE,
... | Deletes the specified object.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the object
@param boolean $allVersions If <code>true</code> then delete all versions of the document, otherwise delete only
the document object specified (default is <code>true</code>)... | entailment |
public function deleteTree(
$repositoryId,
$folderId,
$allVersions = true,
UnfileObject $unfileObjects = null,
$continueOnFailure = false,
ExtensionDataInterface $extension = null
) {
$url = $this->getObjectUrl($repositoryId, $folderId);
$url->getQuery... | Deletes the specified folder object and all of its child- and descendant-objects.
@param string $repositoryId the identifier for the repository
@param string $folderId the identifier for the folder
@param boolean $allVersions If <code>true</code> then delete all versions of the document, otherwise delete only
the docu... | entailment |
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!'... | Gets the content stream for the specified document object, or gets a rendition stream for
a specified rendition of a document or folder object.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the object
@param string|null $streamId The identifier for the renditi... | entailment |
public function getObject(
$repositoryId,
$objectId,
$filter = null,
$includeAllowableActions = false,
IncludeRelationships $includeRelationships = null,
$renditionFilter = Constants::RENDITION_NONE,
$includePolicyIds = false,
$includeAcl = false,
... | Gets the specified information for the object specified by id.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the object
@param string|null $filter a comma-separated list of query names that defines which properties must be
returned by the repository (default i... | entailment |
public function getProperties(
$repositoryId,
$objectId,
$filter = null,
ExtensionDataInterface $extension = null
) {
$cacheKey = $this->createCacheKey(
$objectId,
[
$repositoryId,
$filter,
$extension,
... | Gets the list of properties for an object.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the object
@param string|null $filter a comma-separated list of query names that defines which properties must be
returned by the repository (default is repository specifi... | entailment |
public function getRenditions(
$repositoryId,
$objectId,
$renditionFilter = Constants::RENDITION_NONE,
$maxItems = null,
$skipCount = 0,
ExtensionDataInterface $extension = null
) {
if (empty($objectId)) {
throw new CmisInvalidArgumentException('Ob... | Gets the list of associated renditions for the specified object.
Only rendition attributes are returned, not rendition stream.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the object
@param string $renditionFilter indicates what set of renditions the reposito... | entailment |
public function moveObject(
$repositoryId,
& $objectId,
$targetFolderId,
$sourceFolderId,
ExtensionDataInterface $extension = null
) {
$this->flushCached();
$url = $this->getObjectUrl($repositoryId, $objectId);
$url->getQuery()->modify(
[
... | Moves the specified file-able object from one folder to another.
@param string $repositoryId the identifier for the repository
@param string $objectId the identifier for the object. The repository might return a different/new object id
@param string $targetFolderId the identifier for the target folder
@param string $s... | entailment |
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
@link https://help.shopify.com/api/reference/collect#index
@param array $params
@return Collect[] | entailment |
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);
retu... | Receive a single collect
@link https://help.shopify.com/api/reference/collect#show
@param integer $collectId
@param array $fields
@return Collect | entailment |
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
@link https://help.shopify.com/api/reference/collect#create
@param Collect $collect
@return void | entailment |
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
@link https://help.shopify.com/api/reference/applicationcharge#index
@param array $params
@return ApplicationCharge[] | entailment |
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 $... | Receive a single ApplicationCharge
@link https://help.shopify.com/api/reference/applicationcharge#show
@param integer $applicationChargeId
@param array $fields
@return ApplicationCharge | entailment |
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
... | Create a new one-time application charge
@link https://help.shopify.com/api/reference/applicationcharge#create
@param ApplicationCharge $applicationCharge
@return void | entailment |
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
@link https://help.shopify.com/api/reference/applicationcharge#activate
@param ApplicationCharge $applicationCharge
@return void | entailment |
public function load(array $configs, ContainerBuilder $container)
{
// retrieve each measure config from bundles
$measuresConfig = [];
foreach ($container->getParameter('kernel.bundles') as $bundle) {
$reflection = new \ReflectionClass($bundle);
if (is_file($file = di... | {@inheritDoc} | entailment |
public function getBaseTypeId()
{
$value = $this->getFirstValue(PropertyIds::BASE_TYPE_ID);
if (is_string($value)) {
try {
return BaseTypeId::cast($value);
} catch (InvalidEnumerationValueException $e) {
// invalid base type -> return null
... | Returns the base object type.
@return BaseTypeId|null the base object type or <code>null</code> if the base object type is unknown | entailment |
public function getId()
{
$value = $this->getFirstValue(PropertyIds::OBJECT_ID);
if (is_string($value)) {
return $value;
}
return null;
} | Returns the object ID.
@return string|null the object ID or <code>null</code> if the object ID is unknown | entailment |
private function getFirstValue($id)
{
if ($this->properties === null) {
return null;
}
$properties = $this->properties->getProperties();
if (isset($properties[$id])) {
return $properties[$id]->getFirstValue();
}
return null;
} | Returns the first value of a property or <code>null</code> if the
property is not set.
@param string $id
@return mixed | entailment |
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
@link https://help.shopify.com/api/reference/gift_card#index
@param array $params
@return GiftCard[] | entailment |
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
@link https://help.shopify.com/api/reference/gift_card#show
@param integer $giftCardId
@param array $params
@return GiftCard | entailment |
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
@link https://help.shopify.com/api/reference/gift_card#create
@param GiftCard $giftCard
@return void | entailment |
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($respo... | Update a Gift Card
@link https://help.shopify.com/api/reference/gift_card#update
@param GiftCard $giftCard
@return void | entailment |
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
@link https://help.shopify.com/api/reference/gift_card#search
@param array $params
@return GiftCard[] | entailment |
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
@link https://help.shopify.com/api/reference/customcollection#index
@param array $params
@return CustomCollection[] | entailment |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.