本文整理汇总了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();
}