本文整理汇总了PHP中Akeeba\Engine\Factory::getDomainObject方法的典型用法代码示例。如果您正苦于以下问题:PHP Factory::getDomainObject方法的具体用法?PHP Factory::getDomainObject怎么用?PHP Factory::getDomainObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Akeeba\Engine\Factory
的用法示例。
在下文中一共展示了Factory::getDomainObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getProgress
/**
* Gets the percentage of the backup process done so far.
*
* @return string
*/
public function getProgress()
{
// Get the overall percentage (based on domains complete so far)
$remaining_steps = count($this->domain_chain);
$remaining_steps++;
$overall = 1 - $remaining_steps / $this->total_steps;
// How much is this step worth?
$this_max = 1 / $this->total_steps;
// Get the percentage done of the current object
if (!empty($this->class)) {
$object = Factory::getDomainObject($this->class);
} else {
$object = null;
}
if (!is_object($object)) {
$local = 0;
} else {
$local = $object->getProgress();
}
$percentage = (int) (100 * ($overall + $local * $this_max));
if ($percentage < 0) {
$percentage = 0;
} elseif ($percentage > 100) {
$percentage = 100;
}
return $percentage;
}