本文整理汇总了PHP中OpenCloud\Common\Lang::Translate方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::Translate方法的具体用法?PHP Lang::Translate怎么用?PHP Lang::Translate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenCloud\Common\Lang
的用法示例。
在下文中一共展示了Lang::Translate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rebuild
/**
* Rebuilds an existing server
*
* @api
* @param array $params - an associative array of key/value pairs of
* attributes to set on the new server
*/
public function rebuild($params = array())
{
if (!isset($params['adminPass'])) {
throw new Exceptions\RebuildError(Lang::Translate('adminPass required when rebuilding server'));
}
if (!isset($params['image'])) {
throw new Exceptions\RebuildError(Lang::Translate('image required when rebuilding server'));
}
$object = (object) array('rebuild' => (object) array('imageRef' => $params['image']->id(), 'adminPass' => $params['adminPass'], 'name' => array_key_exists('name', $params) ? $params['name'] : $this->name));
return $this->action($object);
}
示例2: rebuild
/**
* Rebuilds an existing server
*
* @api
* @param array $params - an associative array of key/value pairs of
* attributes to set on the new server
*/
public function rebuild($params = array())
{
if (!isset($params['adminPass'])) {
throw new Exceptions\RebuildError(Lang::Translate('adminPass required when rebuilding server'));
}
if (!isset($params['image'])) {
throw new Exceptions\RebuildError(Lang::Translate('image required when rebuilding server'));
}
$obj = new \stdClass();
$obj->rebuild = new \stdClass();
$obj->rebuild->imageRef = $params['image']->Id();
$obj->rebuild->adminPass = $params['adminPass'];
return $this->Action($obj);
}