本文整理匯總了PHP中eZ\Publish\API\Repository\LocationService::newLocationUpdateStruct方法的典型用法代碼示例。如果您正苦於以下問題:PHP LocationService::newLocationUpdateStruct方法的具體用法?PHP LocationService::newLocationUpdateStruct怎麽用?PHP LocationService::newLocationUpdateStruct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZ\Publish\API\Repository\LocationService
的用法示例。
在下文中一共展示了LocationService::newLocationUpdateStruct方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: parse
/**
* Parse input structure.
*
* @param array $data
* @param \eZ\Publish\Core\REST\Common\Input\ParsingDispatcher $parsingDispatcher
*
* @return \eZ\Publish\Core\REST\Server\Values\RestLocationUpdateStruct
*/
public function parse(array $data, ParsingDispatcher $parsingDispatcher)
{
$locationUpdateStruct = $this->locationService->newLocationUpdateStruct();
if (array_key_exists('priority', $data)) {
$locationUpdateStruct->priority = (int) $data['priority'];
}
if (array_key_exists('remoteId', $data)) {
$locationUpdateStruct->remoteId = $data['remoteId'];
}
$hidden = null;
if (array_key_exists('hidden', $data)) {
$hidden = $this->parserTools->parseBooleanValue($data['hidden']);
}
if (!array_key_exists('sortField', $data)) {
throw new Exceptions\Parser("Missing 'sortField' element for LocationUpdate.");
}
$locationUpdateStruct->sortField = $this->parserTools->parseDefaultSortField($data['sortField']);
if (!array_key_exists('sortOrder', $data)) {
throw new Exceptions\Parser("Missing 'sortOrder' element for LocationUpdate.");
}
$locationUpdateStruct->sortOrder = $this->parserTools->parseDefaultSortOrder($data['sortOrder']);
return new RestLocationUpdateStruct($locationUpdateStruct, $hidden);
}
示例2: newLocationUpdateStruct
/**
* Instantiates a new location update class
*
* @return \eZ\Publish\API\Repository\Values\Content\LocationUpdateStruct
*/
public function newLocationUpdateStruct()
{
return $this->service->newLocationUpdateStruct();
}