
1.版本一
<?php
/**
* Created by Victor
* User: Victor
* Date: 2018/3/16
* Time: 9:54
*/
abstract class Lesson
{
protected $duration;
const FIXED = 1;
const TIMED = 2;
private $_costtype;
function __construct($duration, $costtype = 1)
{
$this->_costtype = $costtype;
$this->duration = $duration;
}
public function cost()
{
switch ($this->_costtype) {
case self::FIXED:
return 5 * $this->duration;
break;
case self::TIMED:
return 30;
本文发布于:2024-02-02 01:39:01,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170681333940585.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
| 留言与评论(共有 0 条评论) |