Facing fatal error given as below.
Fatal error: Class Sugarcode\Test\Model\Total\Fee contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Magento\Framework\DataObject\IdentityInterface::getIdentities) in /home/dukaania/public_html/testing2/app/code/Sugarcode/Test/Model/Total/Fee.php on line 7
Here is my code
<?php
/**
* Copyright © 2015 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Sugarcode\Test\Model\Total;
class Fee extends \Magento\Framework\Model\AbstractModel implements \Magento\Framework\DataObject\IdentityInterface {
const CACHE_TAG = 'mr_dukaaniatest';
protected $_cacheTag = 'mr_dukaaniatest';
protected $_eventPrefix = 'mr_dukaaniatest';
protected function _construct()
{
$this->_init('Sugarcode\Test\Model\ResourceModel\Fee.php');
}
/**
* Collect grand total address amount
*
* @param \Magento\Quote\Model\Quote $quote
* @param \Magento\Quote\Api\Data\ShippingAssignmentInterface $shippingAssignment
* @param \Magento\Quote\Model\Quote\Address\Total $total
* @return $this
*/
protected $_feeFactory;
public function __construct(
\Sugarcode\Test\Model\Total\FeeFactory $feeFactory
) {
parent::__construct($context);
$this->_feeFactory = $feeFactory;
}
public function collect(
) {
parent::collect($quote, $shippingAssignment, $total);
}
public function getIdentities();
public function fetch() {
$fee = $this->_feeFactory->create();
$collection = $fee->getCollection();
foreach($collection as $item){
\Zend_Debug::dump($item->getData());
}
exit();
}
public function execute()
{
$fee = $this->_feeFactory->create();
$collection = $fee->getCollection();
foreach($collection as $item){
\Zend_Debug::dump($item->getData());
}
exit();
}
/**
* Get Subtotal label
*
* @return \Magento\Framework\Phrase
*/
public function getLabel() {
return __('Fee');
}
}