本文整理匯總了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);
}