order = $order; $this->weight = $weight; } /** * 名称 * @return string */ public function getName() { return $this->name; } /** * 标识 * @return mixed */ public function getCode() { return $this->code; } /* * 排序 */ public function getWeight() { return $this->weight; } /** * @return float */ public function getGroup() { return $this->priority; } /* * 返回运费金额 */ public function getAmount() { if (!isset($this->freightAmount)) { $this->freightAmount = $this->_getAmount(); } return $this->freightAmount; } /* * 计算运费金额 */ abstract protected function _getAmount(); /* * 是否需要计算运费 * @return bool true 需要 false 不需要 */ abstract public function needDispatch(); }