public function testVoucherGroupProperties() { $aGroup = new VoucherGroup(); $sName = 'Sales Vouchers'; $iID = 1; $bDisabled = false; $iSort = 100; $oCreated = new DateTime(); $sSlugName = 'sales_vouchers'; $aGroup->setVoucherGroupID($iID); $this->assertEquals($iID, $aGroup->getVoucherGroupID()); $aGroup->setDisabledStatus($bDisabled); $this->assertEquals($bDisabled, $aGroup->getDisabledStatus()); $aGroup->setVoucherGroupName($sName); $this->assertEquals($sName, $aGroup->getVoucherGroupName()); $aGroup->setSortOrder($iSort); $this->assertEquals($iSort, $aGroup->getSortOrder()); $aGroup->setDateCreated($oCreated); $this->assertEquals($oCreated, $aGroup->getDateCreated()); $aGroup->setSlugName($sSlugName); $this->assertEquals($sSlugName, $aGroup->getSlugName()); }
/** * Convert and entity into a data array that match database columns in table * * @return array * @access public * @param VoucherGroup $entity A voucher group entity */ public function demolish($entity) { $aData = array('voucher_group_id' => $entity->getVoucherGroupId(), 'voucher_group_name' => $entity->getVoucherGroupName(), 'voucher_group_slug' => $entity->getSlugName(), 'is_disabled' => $entity->getDisabledStatus(), 'sort_order' => $entity->getSortOrder(), 'date_created' => $entity->getDateCreated()); return $aData; }